Unix Shell or Shell refers to the traditional user interface under Unix or Unix-like computer operating systems. User can type a command type, which is executed by the computer. Therefore it works as command line interpreter. In general, the user has the choice between different shells under Unix. From the language in scope, all the usual Unix shell are as full scripting languages ??used for programming and automation of tasks and the distinction from pure scripting languages ??(e.g. Perl). That is, Unix shell provides special opportunity for the interactive session with the user by issuing a prompt in the simplest case, including the possibility of editing of typed commands or job-control.
General Features of Unix Shell
The commands are received and is executed after the login process. Unix shell make the characteristics of the underlying operating system to take the full advantage. They implement only the bare essentials. External Unix commands are powerful, for example, it includes special commands for text file manipulation, search, edit, replace, word count, character translation, truncation of lines, etc.
Scripts are text files and make small programs; they are written by the user and read when the user is calling the shell to be executed. For example, avoids repeatedly typing commands and simplify the life by collecting these commands in a script. The shell reads the script and executes the commands accordingly. It should be noted that all the commands that you “manually” enter into the shell, can be realized via a script and vice versa. A script that counts from one to 100, can be implemented as follows:
# / Bin / sh I = 1 # set to 1 variable I while test
In later versions of the Bourne shell and in modern unix shells, the commands echo internally, as they are frequently required and the shell no longer needs to be kept small as in very early systems. The text of a script can be written to a file with the command chmod +x to make it executable. It behaves like any other command, but the start of privileged scripts is often limited. The string #! evaluated as executable script in many operating systems, the following characters up to the end of the line as an indication of the program to be started to execute as a script. However, the string is not part of the POSIX standard.
Developments of Unix Shell or Shell
Scripts are indistinguishable from normal programs to use. Some versions of Unix provide with even some commands that are implemented as shell scripts. In particular, commands like man (online manual) and cc (calling C compiler, assembler and linker) are shell scripts on many flavors of Unix. These are commonly known Unix Shell :
- The Thompson shell : Thompson Shell (osh) in 1971-1979 was the default shell of the Unix system. Today the general syntax for redirection of input and output streams is derived from this shell. The pipe concept was first realized in the Thompson shell in 1973. In contrast to the younger shells the Thompson shell was not a programming language. But a program flow was possible with an external if – and goto command. The Thompson shell was replaced in 1979 as the default shell by the Bourne shell.
- The Bourne shell : The ancestor of most modern shells, the Bourne shell (sh) is created by Stephen R. Bourne, together with the Unix V7 in 1977/1978. In almost all commercial Unix variants continues to use a later version of the Bourne shell, even if they use (bin / / sh) as a system shell is being replaced by other shells. This shell has already all the essential features such as pipes , background processes, control structures. Regarding the command line editing, the shell leaves the terminal driver, which only allows deleting the entire row (CTRL-U) and the last character (DEL). Over time, the original version has been expanded and modified. The name is obtained with the variant of the AT & T Unix. Since the release of BSD 4.1, csh with the Bourne shell is usually only for scripts, especially those that perform the tasks of the system used, because it does not provide for interactive editing operation. For this, further developments are tcsh, ksh, bash are much better.
- The C shell : Bill Joy developed it for the second BSD distribution (BSD2) at Berkeley in 1979, a shell, that is more on the C -oriented syntax, the C shell (csh). This shell already allows command line editing, but not interactive, but with a special syntax. It also allows repeating (and editing) of old commands. In addition, for the first time the job control option is implemented. The C shell has many popular features that were later adopted by bash,. Today, the C shell is very little used, it is replaced by the other shells like tcsh, ksh (Korn shell), bash (Bourne again shell) or zsh.
- The job control shell : The job control shell is a Bourne shell (specifically the SVR4 version, so first appeared on the AT & T Unix “System V Release 4″), which at job control features (as they are known to the C shell has been) are extended. These are often used by the same program that has the additional properties (e.g. the command bg , fg , jobs , kill , stop , suspend , wait ), jsh is used under the name sh.
- The Bourne Shell Again : B-ourne a gain-sh ell (bash) is part of the GNU project. The Bash is largely compatible with the original Bourne shell (sh), but significantly expanded in functionality. The Bash (/ bin / bash) is the default shell on both the most Linux systems as well as under Mac OS X and has been ported to virtually all Unix systems.
- The Z shell : The Z shell (zsh) is a shell with lots of possibilities. It is very similar to the Korn shell and also assumes the functions Bourne Shell Again and the TENEX C Shell. But it is in many ways has own way of works and is considered one of the most powerful among the Unix shells. They can be used as a login shell, an interactive shell and as interpreter for shell scripts.
- Other Shells : The Almquist shell (ash), The Debian Almquist Shell (dash), The TENEX C Shell (tcsh), Red Hat have the nash, sash (stand-alone shell) is trimmed to ensure that as many external commands are replaced by the internal functions of the shell. Thee are actually many shells.