Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell commands are written in what language?

There are many shell commands, like

ls, cd, cat etc.

what programming language is used in writing these commands? How are they compiled?

My understanding:

Shell is a program which takes command; ** does this mean that it interprets those commands(like ls is interpreted by shell program)?**

One more question, what language is Shell program written in?

like image 770
CODError Avatar asked Sep 27 '13 09:09

CODError


People also ask

Is shell script written in C?

C shell's scripting syntax is modeled after the C language in some aspects. Small programs can be created by writing scripts using the C shell syntax. The Bourne shell is also an option to create Unix scripts but if you are reading this book you probably decided the C shell fits your requirements better.

What is shell language called?

Shell Scripting is the language of the linux terminal. Shell scripts are sometimes referred to as “shebang” which is derived from the “#!” notation. Shell scripts are executed by interpreters present in the linux kernel. Interpreters include: bash, csh, zsh e.t.c. Most popular of which is bash.

Where is shell script written?

Shell Scripts are written using text editors. On your Linux system, open a text editor program, open a new file to begin typing a shell script or shell programming, then give the shell permission to execute your shell script and put your script at the location from where the shell can find it.


2 Answers

Most of the basic utilities in linux are written in C .This u can verify in busybox source code which supports most of basic linux command utility which are written in C. So command like ls,cd ...etc are in c

How shell will interpret check in below link

in an operating system there is a special program called the shell. The shell accepts human readable commands and translates them into something the kernel can read and process.

http://www.math.iitb.ac.in/resources/manuals/Unix_Unleashed/Vol_1/ch08.htm

like image 168
vinay hunachyal Avatar answered Sep 29 '22 10:09

vinay hunachyal


These programs are mainly written in the C programming language as is the linux kernel.

like image 23
Paul Evans Avatar answered Sep 29 '22 09:09

Paul Evans