[Next] [Previous] [Up] [Top] [Contents] [Index]
Chapter 9: Working Environment
This section discusses the FUE-customized login files (also called the Fermi files) used to set up your UNIX environment. All the files discussed in this section are printed in Appendix C. You will automatically have your own copy of these files in your home directory[42]. The default files exist in /usr/local/etc and you can recopy them to your home directory if you ever need to. Once you understand the functions of the various files, you can tailor them to suit your tastes.
Many of these files include sample code that you may want to activate. A pound sign (#) in the first column indicates a comment line. To activate a command line that's been "commented out", remove the #.
The C shell executes hidden FUE-customized files at various times in your session. They include the files .cshrc and .login, which you may choose to further modify.
When you log out, the shell looks for a logout script in your home directory called .logout. FUE does not provide this file, but you can create it yourself, and it will get run automatically. This file is not required.
As an example, including the clear command in your .logout file contents clears the screen when you logout.
[Missing image]If your system is running AFS, we recommend including the unlog command in the .logout file. This is explained in section 7.3.4.
Upon logging in, the first file to execute is the .cshrc located in your home directory. The shell also executes this file each time you invoke a new C shell, for example when you execute a C shell script or otherwise fork a new process.
Your .cshrc file first executes /usr/local/etc/fermi.cshrc, which:
/usr/local/etc/setpath.csh (see section C.1.3), and MANPATH
fermi.cshrc also calls /usr/local/etc/local.cshrc which may set other environment variables.[43] You do not have a copy of fermi.cshrc in your home directory; it is not designed to require individual customization. See section C.1.2 for the file listing.
The file .cshrc should contain all your aliases so that child processes have access to them; many suggested aliases are provided for you to activate, and you can define your own. You can also set shell variables (noclobber and ignoreeof are already set for you) and parameters that are local to a shell.
Don't set any environment variables here. Any changes to their values will remain after you terminate a forked process, thus changing your standard environment for the duration of your login session. See section C.1.1 for the default file listing.
The .login file is executed only at login time. After execution of .cshrc, the .login file located in your home directory is run. The default .login file first executes the file /usr/local/etc/fermi.login.
fermi.login performs several actions:
You do not have a copy of fermi.login in your home directory; it is not designed to require individual customization. See section C.1.6 for the file listing.
Next, the .login file sets your prompt, and sets the variables history and savehist. You can edit your .login to modify your path and/or terminal settings, change the default values of environment variables or create your own, and/or include commands that you want to execute once, at the beginning of each session (for instance setup product commands). See section C.1.5 for the default file listing.
The C shell executes the .logout file in your home directory (if you have created one) when you log off the system.
If you modify your .cshrc or .login files and you want them to take effect in the current session, you must execute them with the source command:
% source .cshrc % source .login
This is explained in section 4.4.
The Bourne shell executes hidden FUE-customized files at various times in your session. When you log on in the Fermi environment, the .profile and .shrc files in your home directory are executed for sh, bash, and ksh. Your .shrc file is also executed at any time a new bash or ksh is invoked.[44]
The name of the file .shrc is determined by the ENV environment variable which is set to ~/.shrc in the standard .profile, it is not a standard UNIX feature.
The .profile file first executes /usr/local/bin/fermi.profile. This file performs several actions:
/usr/local/etc/setpath.sh; see section C.2.3) and MANPATH.
You do not have a copy of fermi.profile in your home directory; it is not designed to require individual customization. See section C.2.2 for the file listing.
The .profile file sets your prompt and the variables that govern your history list, your default editor, and your command line editor. You can edit your .profile to modify your path and/or terminal settings, change the default values of variables[45] or create your own, and/or include commands that you want to execute once, at the beginning of each session (for instance setup product commands). See section C.2.1 for the default file listing.
The .shrc file first executes /usr/local/etc/fermi.shrc which sets up UPS and performs some machine-dependent functions. See section C.2.5 for the default file listing.
The .shrc file should contain all your aliases[46] so that child processes have access to them; many suggested aliases are provided for you to activate, and you can define your own. You can also set variables (noclobber and ignoreeof are already set for you except in sh) and parameters that are local to a shell, and you can activate and define functions. See section C.2.4 for the default file listing.
If you modify your .shrc or .profile files and you want them to take effect in the current session, you must execute them with the . command:
$ . .shrc $ . .profile
This is explained in section 4.4.
If you wish to maintain versions of distributed code customized to your own needs, we recommend that you store them in the following directories:
$HOME/bin for machine-neutral code
$HOME/bin.$ARCH for architecture-specific code; $ARCH is the value returned by funame -s (e.g., SunOS, IRIX).
The path names for these directories will be added to your PATH when the Fermi files are invoked.
fermi.* and setup.* files which are called directly from /usr/local/etc.
/bin/sh is a link (links are described in section 6.3.5) to the korn shell (ksh). ksh is a superset of sh, so this shouldn't present any problems for you. One difference is that your .shrc file gets sourced when you run /bin/sh scripts.