Shell



The word Shell is an application / binary / program in Linux/ Unix machines.

Details
The main purpose of a shell (the program) is to act as an interface between the Operating System's Kernel and the user. Basically when you type ls command in the shell programs like /bin/bash, ksh, sh, csh or tcsh, shell or those programs are taking the keyboard inputs of `ls` and when  you type an ‘Enter’ it passes `ls` command to the shell. The shell tries to interpret those keystrokes as commands.

The shell applies its built-in rules to figure out that you want to run the executable command in the file /bin/ls. It makes a system call asking the kernel to start /bin/ls as a new child process and give it access to the screen and keyboard through the kernel. Then the shell goes to sleep, waiting for ls to finish.

When /bin/ls is done, it tells the kernel it's finished by issuing an exit system call. The kernel then wakes up the shell and tells it it can continue running. The shell issues another prompt and waits for another line of input.

It's called a shell because it wraps around and hides the operating system kernel.

Other usages of word shell in an Unix box
The /etc/shells file contains a list of login shells on the system. Applications use this file to determine whether a shell is valid

=======================================================

sarath@sage3:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/screen
======================================================

For more details, check References

References
http://www.iitk.ac.in/LDP/HOWTO/Unix-and-Internet-Fundamentals-HOWTO/running-programs.html
http://www.lancs.ac.uk/~tipper/writing/luui/html/unix-intro007.html




No comments: