Shells Shells WildChar
.login' Profile and `
As you probably remember from the first section, the outermost layer in the UNIX structure is the Shell, or command interpreter. The Shell, however, is simply a program called upon to interpret the commands users type, and as such, there are many different versions of the Shell. The two most widely used shells are the Bourne Shell (sh) and the C-Shell (csh). The shell that you will probably be using is tcsh, an improved version of the older csh (Use the ps command to determine which shell you are using). You can easily switch shells by typing in the name of the desired shell at the prompt (provided that your PATH has been suitably configured).
Besides several cosmetic changes, tcsh offers two important new features:
TABand tcsh will complete the command or file name as much as possible, making it much quicker to enter long names.
When you log in, your shell will execute a startup file known as
.login'. This file will contain specific commands that you would
always want to execute at the beginning of each login session (such as
checking for new messages). The `
.login' file that the new user
gets looks like this:
if ( $?DISPLAY ) then
To have the date and time echoed at login, just insert the command date; to set certain characters to special meanings use command stty (i.e. stty erase '^H' kill '^U').
.cshrc' is another initialization file that contains
directions that you want to be done for every shell (such as setting up
aliases for your favorite commands). The typical `
.cshrc' file is:
setenv EDITOR emacs
setenv PATH .:$HOME/bin:/usr/lang:/usr/ucb:/bin:/usr/bin:
setenv MANPATH /usr/lang/man:/usr/man:/usr/local/man
setenv TEXINPUTS .:$HOME/tex:/usr/local/lib/tex/inputs//
setenv HOST `hostname`
set history = 40
set ignoreeof noclobber notify filec
if ( `basename $shell` == csh ) then
set prompt = "[$HOST|\!] "
set prompt = "[%M|%h] "
The PATH setting above is very important since it tells
the shell where to look for the programs that you enter as executable
commands. Note that the current directory . is searched first,
followed by your home `
~/bin', and finally various system
directories. To set an alias such as having bye mean logout,
alias bye 'logout' in the file.