next up previous contents index
Next: Entering Commands Up: CERN UNIX User Guide Previous: Setting Passwords

UNIX Shells

Once you have successfully logged in, you are in an environment called a shell. This is a process which has been started (spawned) at the end of the login process . A new shell  is also started for each invocation of a terminal window. A shell is the interface between the operating system and the user. It interprets the commands you type and the keys you press in order to direct the operating system to take an appropriate action.

There are two families of shell: one is based on the Bourne   Shell (sh)  and includes also the Korn   Shell (ksh) , the Bourne Again Shell  (bash)  and the superKorn Shell (zsh)  ; the other family is based on the Berkeley/C Shell   (csh)  and includes also tcsh   which is an enhanced csh. This Guide will not try to distinguish the different features of these shells; if you are interested in deciding which shell has the features you prefer, we recommend reading the document "A Shell Comparison" by Arnaud Taddei, reference CN/DCI/162, available from the Self Service shelves of the UCO in Building 513; this presents an excellent comparison of features between the shells. Also you might wish to get a copy of "tcsh and zsh for Pedestrians", CN/DCI/163, also from the UCO which presents an introduction to these two shells.

On most platforms, you will find that the Bourne, C and Korn shells are provided with the system while you will have to install the others yourself.gif The choice of which shell to use will depend on what type of work is being carried out. It has been found that the Bourne flavour is often better-suited for shell script programming whereas one of the more modern shells is better for interactive use. However, often the use of a particular shell is a highly personal choice.

Not all UNIX systems offer the same shell for their default. You can determine which shell you are in with the echo $SHELL command. Under the C shell this will give you the following lines:

 
               		  echo $SHELL

/bin/csh

The env and printenv commands will also give you this information, along with many other environment variables (see later in this Guide).

However, all these commands will show you only your login shell. If you have invoked another shell and you use one of these commands, you will be informed about your login shell, not the new shell you invoked. The C shell is designated as csh, the tcsh shell by tcsh, the Bourne shell sh, the Bourne Again shell bash and the Korn shell by ksh.

It is possible to invoke a new shell (subshell) on top of your current shell by simply typing its name. If you wish to change your default shell you can do this with the command chsh (change shell); not supported in Solaris 2 or SGI systems.

Once you enter a subshell, you can exit again by typing

 
               		  exit

If you repeat the exit command once more, your terminal emulation is closed, and the terminal window disappears. Instead of exit, you may need to enter <Ctrl-D>.





next up previous contents index
Next: Entering Commands Up: CERN UNIX User Guide Previous: Setting Passwords



Alan Silverman
Wed Apr 12 16:54:02 METDST 1995