Shell Start-Up Files

We have seen that the shell automatically defines some environment variables at login time. The values assigned to these variables are obtained from fields within the password file, but how do the others get set up?

These need to be assigned at login time, but to save this being done manually every time you log in, each shell provides a method of automating this process using files called “profiles.” If the system administrator wants to set specific environment variables that will apply to all users on the system, the variables would be set up in the system-wide profile, which is /etc/profile.

The shell executes this file every time a user logs in. It will generally contain assignments for such variables as $PATH (so users ...

Get Solaris™ Operating Environment Boot Camp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.