Trusted Solaris Administrator's Procedures

Controlling Which Startup Files Are Read When a Shell Comes Up

As in the Solaris environment, shell initialization files are used to set search paths and other environment variables and to execute some useful commands and functions. The following table shows which startup files are read by default when each type of shell is launched.

Table 3-3 Startup Files Read at Shell Initialization
 Shell Startup File
 C shell

$HOME/.cshrc

$HOME/.login

 Bourne shell$HOME/.profile
 Korn shell

$HOME/.profile

file specified with ENV variable 

Profile shells (see pfexec(1) man page)

$HOME/.profile

The .profile or .login files are invoked only if the shell is also identified as the account's login shell. A shell that is invoked with a prefix of - (for example: - csh) is a login shell. This means, for example, that when a C shell is started using csh (without a - prefix), the .login file is not executed.