export

mark names for export 

KornShell Built-in


SYNOPSIS

export [name[=value] ...]

export -p


DESCRIPTION

export marks each name so that the current KornShell exports it automatically to the environment of all commands executed from that shell. Exported variables are thus available in the environment to all subsequent commands. Several commands (for example, cd, date, and vi) look at environment variables for configuration or option information.

Variable assignments of the form name=value assign value to name as well as marking name for export.

Calling export without arguments presents a list, with appropriate quoting of the names and values of all variables in the format:

Variable="value"

If you re-input this format to another shell, variables are assigned appropriately but not exported. The -p option lists variables in a format suitable for re-input to the shell (see the description of the -p option).

The exporting of environment variables is one way in which the MKS KornShell differs from cmd.exe. cmd.exe always export all currently defined environment variables; the MKS KornShell only exports those that you have marked for export (through the export command or some other mechanism).

Options

-p 

lists variables in the form

export name="value"

suitable for re-input to the shell.


DIAGNOSTICS

Possible exit status values:

0 

Successful completion.

1 

Failure due to invalid command line argument.

2 

Failure resulting in a usage message, usually due to invalid command line option.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0. Windows 2000. Windows XP. Windows Server 2003. Windows Vista.

export is a special built-in command of the Bourne Shell and KornShell on UNIX systems.


NOTE

This is a special built-in command of the MKS KornShell.


AVAILABILITY

MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
cd, date, set, sh, typeset, vi


MKS Toolkit 9.2 Documentation Build 16.