Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


export command (exports shell variables)

Organization of this page

Format

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

Description

This command exports specified shell variables. If the -p option and name argument are both specified, export of the variables specified in name takes precedence.

If the command is executed with no options specified, it outputs to the standard output the names of all the currently exported variables.

Arguments

-p

Specifies that all currently exported variables are to be output to the standard output in the format export variable-name=value.

name

Specifies the name of a variable that is to be exported.

When you export shell variables in Windows, the supported variable names vary as follows:

  • When DISABLE is specified in the VAR_ENV_NAME_LOWERCASE parameter

    All letters contained in variable names must be in uppercase because shell variables whose names contain lowercase letters cannot be exported.

    If you attempt to export a shell variable whose name includes lowercase letters, the command outputs an error message and exits the batch job.

  • When ENABLE is specified in the VAR_ENV_NAME_LOWERCASE parameter

    Shell variables whose names contains lowercase letters can be exported.

    Note that environment variables are not case sensitive. The last shell variable with the same spelling that was exported becomes the final environment variable value. Shell variables with the same spelling but in a different case are considered to be different values regardless of whether they are exported.

For name, you can specify multiple names of variables or arrays that are to be exported. If an array name is specified, the command exports all the elements that constitute the array. Even if you specify a single element of an array, all the elements of the array will be exported.

If you specify a variable that has not yet been created, the variable will be created and exported simultaneously. However, if you do not specify a value for the variable in such a case, the linefeed character will be set as the value and then the variable will be exported.

If the read-only attribute is set for a shell variable that is specified, and you attempt to specify a value for it, the command will terminate with an error.

value

Specifies a value that is to be assigned to the paired specified variable.

When =value is specified, the specified value is assigned and the variable with the specified value is exported simultaneously. When this argument is omitted, the specified variable is exported using the value that is already set for it.

Return codes

Return code

Meaning

0

Normal termination

1

Error termination

Notes

Usage example