In the Bourne shell
and in the Korn shell, use the
export
command
to export one or more variables to the environment. For example,
these commands make the value of the variable
scname
available
to all subsequent shell scripts:
$ scname=phonelist
$ export scname
In the Korn shell, you can combine
these commands into one command:
$ export scname=phonelist
If you change the value
of
scname
, then the new value affects both
the shell variable and the environment variable. If you do not export
a variable, only the shell script in which you define has access to
its value.