The following sections provide examples of user and site initialization files that you can use to start customizing your own initialization files. These examples use system names and paths that you need to change for your particular site.
(Line 1) PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/ccs/bin:. (Line 2) MAIL=/var/mail/$LOGNAME (Line 3) NNTPSERVER=server1 (Line 4) MANPATH=/usr/share/man:/usr/local/man (Line 5) PRINTER=printer1 (Line 6) umask 022 (Line 7) export PATH MAIL NNTPSERVER MANPATH PRINTER |
Defines the user's shell search path
Defines the path to the user's mail file
Defines the user's Usenet news server
Defines the user's search path for man pages
Defines the user's default printer
Sets the user's default file creation permissions
Sets the listed environment variables
(Line 1) set path=($PATH $HOME/bin /usr/local/bin /usr/ccs/bin) (Line 2) setenv MAIL /var/mail/$LOGNAME (Line 3) setenv NNTPSERVER server1 (Line 4) setenv PRINTER printer1 (Line 5) alias h history (Line 6) umask 022 (Line 7) source /net/server2/site-init-files/site.login |
Defines the user's shell search path.
Defines the path to the user's mail file.
Defines the user's Usenet news server.
Defines the user's default printer.
Creates an alias for the history command. The user needs to type only h to run the history command.
Sets the user's default file creation permissions.
Sources the site initialization file.
The following shows an example site initialization file in which a user can choose a particular version of an application.
# @(#)site.login main: echo "Application Environment Selection" echo "" echo "1. Application, Version 1" echo "2. Application, Version 2" echo "" echo -n "Type 1 or 2 and press Return to set your application environment: " set choice = $< if ( $choice !~ [1-2] ) then goto main endif switch ($choice) case "1": setenv APPHOME /opt/app-v.1 breaksw case "2": setenv APPHOME /opt/app-v.2 endsw |
This site initialization file could be referenced in a user's .cshrc file (C shell users only) with the following line:
source /net/server2/site-init-files/site.login |
In this line, the site initialization file is named site.login and is located on a server named server2. This line also assumes that the automounter is running on the user's system.