- UNIX shell act as a command interpreter.
- It gathers input from the user and executes programs based on that input when a program finishes executing; it displays that program’s output.
- Also, It is the primary interface between a user sitting at his terminal and operating system unless the user is not using a graphical interface.
- A shell is an environment in which user can run our commands, programs, and shell scripts.
- Moreover, There can various kinds of shells such as sh (Bourne shell), csh (C shell), ksh (Korn shell) and bash.
- When any user logs in, a shell is started.
- Also, The shell has the terminal as standard input and standard output.
- It starts out by typing the prompt, a character such as $, which tells the user that shell is waiting to accept command.
- For example, if user types date command, $ date sat Mar 12 08:30:19 IST 2016
- The shell creates a child process and runs date program as the child.
- While the child process is running, the shell waits for it to terminate.
- Moreover, When the child finishes, the shell types the prompt again and tries to read the next input line.
- Shell is work as interface, command interpreter and programming language.
Shell – As interface
- Shell is an interface between user and computer.
- The user can directly interact with the shell.
- Shell provide command prompt to the user to execute commands.
Shell – As command interpreter
- It read command enter by the user on prompt.
- It Interprets the command, so the kernel can understand it easily.
Shell – As programming language
- Shell also works as the programming language.
- It provides all features of the programming language like variables, control structures, and loop structures.