export - Set export attribute for variables

Synopsis

export [ -ps ] [ name [ =value ] ... ]

Description

You can use export to set the export attribute for the variables specified by name. A variable with the export attribute is automatically placed in the environment of subsequently executed commands.

When no arguments are specified, qsh displays a list of all the variables with the export attribute and their values.

Options

-p
Precede each line of the output with the word "export " so it is displayed in a re-enterable format.
-s
Also set the variable as an environment variable in the current process.

Operands

Each name specifies a variable in the current environment. If a value is also specified, the value of the variable is updated.

Exit status

  • 0 when successful.
Examples
  1. Set the export attribute for an existing variable:
    
    export ALPHA
    
  2. Set the value and export attribute of a new variable:
    
    export ALPHA=one
    
  3. List all variables with the export attribute:
    
    export