Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
4.  Managing User Accounts and Groups (Overview) Customizing a User's Work Environment Examples of User and Site Initialization Files Example--.profile File  Previous   Contents   Next 
   
 

Example--.cshrc File

1 set path=($PATH $HOME/bin /usr/local/bin /usr/ccs/bin)
2 setenv MAIL /var/mail/$LOGNAME 
3 setenv NNTPSERVER server1 
4 setenv PRINTER printer1 
5 alias h history 
6 umask 022 
7 source /net/server2/site-init-files/site.login 
  1. Defines the user's shell search path.

  2. Defines the path to the user's mail file.

  3. Defines the user's Usenet news server.

  4. Defines the user's default printer.

  5. Creates an alias for the history command (the user will need to type only h to run the history command).

  6. Sets the user's default file creation permissions.

  7. Sets the listed environment variables.

Example--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.

 
 
 
  Previous   Contents   Next