Environment File

Many systems have an environment file that the system administrator uses to set some basic environments for all users. Typically, this file is located in the /etc directory and can be called env, ENV, environment, or environments. If your system has such a file, another file (such as .profile) contains a line that invokes this script. In addition, some systems have a universal profile that is called as well. A typical Linux system, for example, has one or more files in the /etc/profile.d/ directory that execute at the end of a user's customized profile. The following is an example of such a call:

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done
unset i

This snippet of code sets up a variable (i) containing ...

Get Korn Shell Programming by Example 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.