Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (d - f) export(1)
NAME
export - Allows values of variables to be used by other commands
SYNOPSIS
export [name[=value ...]]
export -p
FLAGS
-p Writes the names and values of all exported variables.
DESCRIPTION
The export command marks the name and value, specied as the name and value arguments, for
automatic export to the shell environment.
If -p is specied, export writes the names and values of all exported variables to standard output.
The command export -p allows portable access to the value that can be saved and then later
restored by using, for example, a . (dot) script. The shell formats the output, including proper use
of quoting, so that it is suitable for reinput to the shell, as commands that achieve the same export-
ing results.
EXAMPLES
1. The following example denes a umask value of 066 and exports this value to the shell
where it will be used for all new les and directories created during the shell process.
export umask=066
2. The following command lists all exported variables and their values in effect for the
current shell process.
export -p
NOTES
Parameter assignment lists that precede the command remain in effect when the command
completes.
I/O redirections are processed after parameter assignments.
Errors cause a script that contains the commands so marked to abort.
Words, following a command specied as command, that are in the format of a parameter
assignment are expanded with the same rules as a parameter assignment. This means that
(tilde) substitution is performed after the = (equal sign). Word splitting and lename
generation are not performed.
The export command is a shell built-in command. It differs from the regular commands in that it
does not open a new shell process when it executes.
A general discussion of shell built-in commands and a list of the OSS shell built-in commands are
in the reference page for sh(1).
RELATED INFORMATION
Commands: sh(1).
527188-004 Hewlett-Packard Company 3121