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?
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.
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.
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.
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
These programs are mainly written in the C programming language as is the linux kernel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With