The Environment File

Once the profile files are processed, the Korn shell checks the environment file, which is specified by the ENV variable. The environment file usually contains aliases, functions, options, variables and other environment settings that you want available to subshells. Besides being processed at login, the environment file is processed each time a new Korn shell is invoked. There is no default value for ENV, so if not specifically set, this feature is not enabled. A sample environment file is included in Appendix B.

Because the environment file must be opened and read each time a new Korn shell is invoked, performance can be adversely affected by having a large environment file with lots of functions.

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The 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.