DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Customizing your environment

Exporting variables to the environment

Variables stored in the environment are visible to you within the shell; but variables you set within your shell session are not accessible to other programs running in the environment until you make them so by explicitly exporting them.

To export a shell variable to the environment, use the export command. For example, in the Bourne and Korn shells:

   $ FOO=bar
   $ export FOO
In the Korn shell, the following alternative form exists:
   $ export FOO=bar
In the C shell:
   % setenv FOO bar
This will cause the variable FOO to be exported to any processes started from within the current shell.

You can export more than one variable at a time with the export command by listing a set of variable names to be exported. (There may already be an export command in your startup file. In this case, add the name of the additional variable to the end of the list of variables for export.) For example:

.
.
.
#
PATH=/bin:/usr/bin:/u/bin:/usr/local/bin:/local/bin:${HOME}/bin:
LOGNAME=charles
MAIL=${HOME}/.mailbox
.
.
.
export PATH LOGNAME ...
.
.
.

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004