As seen above, the order in which the files are executed on logging in to a Sun differs slightly from that of a Silicon Graphics system.
Although the order of execution of the .login file on a Sun and on an SGI differs, their content is very similar. Table 15.1 should help you decide what to put in which file.
Table 15.1: .cshrc and .login File Content
The following few examples show how definitions can be put into the .cshrc and .login files:
# if the device I'm logging into is not the console, stop here.
if ("\,`tty`\," != "/dev/console") exit
sunview
# if the device I'm logging into is not the console, stop here.
# if it is the console, give me five seconds to stop execution.
if ("\,`tty`\," != "/dev/console") exit
echo -n "Sunview? (\^{ }C to interrupt)"
sleep 5
sunview
logout
# this system has a local directory for man pages.
setenv MANPATH /usr/local/catman:/usr/catman
# path definition. Note the ($path) in the second line
set path = (. ~/bin /usr/bsd /bin /usr/bin /usr/sbin /usr/local/bin)
set path = ($path /usr/bin/dn /usr/local/tex/bin)
# setup your prompt.
set prompt = "! system> " (C shell)
set prompt = "%! %~ > " (Tenex shells)
The first gives history number, followed by the
string system>, whereas
the second gives history number, and directory path of current directory.
set history = 40
set savehist = 40
alias ls ls -C
alias bye logout