Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


2.5 Specifying environment variables

The table below lists and describes the environment variables supported by JP1/Advanced Shell.

Important

JP1/Advanced Shell sets and references shell and environment variables whose names begin with ADSH. Therefore, do not use a shell variable or an environment variable whose name begins with ADSH for any purpose other than those described in this manual.

Table 2‒15: Environment variables supported by JP1/Advanced Shell

Environment variable name

Information to be specified

Timing of specification when the value is set automatically

Whether a value can be specified

ADSH_AJS_APPEXEC

(for Windows execution environments only)

For indicating the GUI application execution program for custom jobs

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_APPNAME

(for Windows execution environments only)

Path name of the application for executing custom jobs

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_APPARG

(for Windows execution environments only)

Argument for the application for executing custom jobs

When the job starts if the program has been started with a job

Yes#1

ADSH_AJS_WORKF

(for Windows execution environments only)

Work folder for custom jobs

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_SHOWN

(for Windows execution environments only)

Name to be displayed for a custom job

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_AFEXECMV

(for Windows execution environments only)

Action after executable application for custom jobs

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_MESOUT

(for Windows execution environments only)

Message output for custom jobs

When the job starts if the program has been started with a custom job

Yes#1

ADSH_AJS_ENVF

Job environment file name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_GCHE

Check option for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_LHOST

Logical host name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_AJS_SCRF

Job definition script file name for custom jobs

When the job starts as a custom job

Yes#1

ADSH_ENV

Job environment file name

When the job starts as a custom job

Yes#2

ADSH_CMD_ARGORDER#3

Rule for determining the order of the command arguments specified on the command line. The only permitted value is seq.

This environment variable has effect in the cp, cut, date, diff, expand, gunzip, gzip, ln, ls, mv, and stat commands. It also has effect in the analysis of user-defined options in the getopt command.

(Not specified automatically.)

Yes

ADSH_CMDDATE_FORMAT

Format specification code of the date command that executes the common format process unique to JP1/Advanced shell

(Not specified automatically.)

Yes

ADSH_CMDEXPR_LENGTH

Character string length. This environment variable is specified when the length operator is used in the expr command.

Specify b to acquire the character string length in bytes, and specify c to acquire the character string length in characters.

If this environment variable is omitted or a value other than b or c is specified, length is not treated as an operator.

(Not specified automatically.)

Yes

ADSH_CMDLN_FOLLOW

This command sets whether to follow the link when a symbolic link for a directory has been specified for the argument target of the ln command.

Set NO to not follow the symbolic link. Set a value other than NO to follow the symbolic link.

(Not specified automatically.)

Yes

ADSH_CMDLN_OPT_I_F

Sets the option to be enabled when the -i option and the -f option are both specified for the ln command.

Set LAST to enable the option specified last.

(Not specified automatically.)

Yes

ADSH_CMDTAR_ROOTPATH

This command changes the behavior of the root directory of the tar command. This command stores, extracts, and displays the root directory without eliminating the root directory when absolute is specified for the values.

(Not specified automatically.)

Yes

ADSH_JOB_NAME

Job name

When the job starts

No

ADSH_JOBID

Job ID (fixed 6-digit decimal number with leading zeros added)

When the job starts

No

ADSH_JOBRC_FATAL

Job return code in the event of a fatal error that interrupts job processing such as syntax errors.

For details about how to specify the environment variable, see (2) ADSH_JOBRC_FATAL environment variable (specifies the return code in the event of an unresumable error in jobs).

(Not specified automatically.)

Yes#2

ADSH_LANG

(UNIX only)#4#6

The language and encoding in which messages are output by JP1/Advanced Shell.

Set this environment variable if you want to temporarily change the messages that the adshexec command for a specific job outputs.

For details about the specifiable values, see 2.2.4 Encoding used in JP1/Advanced Shell.

If this environment variable is set within a job definition script or an environment file, the value of such an environment variable is valid only for a child job, root job, or shell operation command (other than the adshexec command) that starts from a job definition script.

(Not specified automatically.)

Yes

ADSH_LANG_JP1EVENT

(UNIX only)#5

The language of messages output by JP1 events that are generated by the user-reply functionality. Set this environment variable if you want JP1 event messages to be output in a different language, in accordance with the settings of JP1/IM at the output destination, from the language in which messages are output by JP1/Advanced Shell.

For details about the specifiable values, see 2.2.4 Encoding used in JP1/Advanced Shell.

If this environment variable is set within a job definition script file, the value of such an environment variable is valid only for a child job, root job, or shell operation command (other than the adshexec command) that starts from a job definition script. If this environment variable is set within an environment file, JP1 event messages from a job definition script are output in the language that conforms to the value.

(Not specified automatically.)

Yes

ADSH_LINK_SUPPORT

[Only for Windows]

This command specifies the link response level of JP1/Advanced Shell.

For details about how to specify the environment variable, see (4) Environment variable ADSH_LINK_SUPPORT (defining the link support level of JP1/Advanced Shell).

(Not specified automatically.)

Yes#7

ADSH_STEP_NAME

Job step name.

When a command outside the job step is executed or when a job step name is omitted, the environment variable is not defined.

When the job step starts

No

AJS_BJEX_STOP

Interface used for forced termination from JP1/AJS. This environment variable must be defined when JP1/Advanced Shell batch jobs are defined in PC or UNIX jobs. Define the environment variable in PC or UNIX job definitions, not in OS settings.

When the job starts as a custom job

Yes (Only TERM is permitted.)

BLOCKSIZE

Number of bytes per block. This environment variable is used in the ls and stat commands.

The default is 512.

(Not specified automatically.)

Yes

COLUMNS

Output width per line of command execution results. This environment variable is used in the -C option of the ls command and the l editing command of the sed command.

(Not specified automatically.)

Yes

GETOPT_COMPATIBLE

Parameter analysis method. This environment variable is used in the getopt command.

There is no rule for the value to be set. If a value is set, JP1/Advanced Shell assumes that the getopt command is specified in format 1 for all arguments to be analyzed.

(Not specified automatically.)

Yes

GZIP#8

This environment variable sets the options for the gzip and gunzip commands. This environment variable is used in the following commands:

  • The gzip command

  • The gunzip command

  • The tar command (when the -z option is specified)

For the gzip and gunzip commands, the options set in the arguments take priority. To specify more than one option, use one or more space or tab characters to delimit the options.

(Not specified automatically.)

Yes

POSIXLY_CORRECT#3

Rule for determining the order of the command arguments specified on the command line.

There is no rule for the value to be set. If a value is set, the handling is the same as when seq is specified in the ADSH_CMD_ARGORDER environment variable.

(Not specified automatically.)

Yes

TMPDIR

(UNIX only)

Directory to which temporary files are output. This environment variable is used in the diff and sort commands.

(Not specified automatically.)

Yes

#1

These environment variables can be used only in the unit definitions in JP1/AJS's ajsdefine command and in the job definitions in JP1/AJS - Definition Assistant. Do not use these environment variables in the JP1/Advanced Shell's job definition scripts or user environments, such as user profiles and system profiles.

#2

If an environment variable is set within a job definition script or an environment file, the value of such an environment variable is valid only for a child job or root job that is started from a job definition script.

#3

The POSIXLY_CORRECT environment variable has effect in the standard Linux OS commands as well as in the commands in which the ADSH_CMD_ARGORDER environment variable has effect, but the environment variable might have additional functionality other than the rule for determining the specification order of the command arguments. Therefore, if the only thing you want to do is to set a rule for determining the specification order for command arguments for UNIX-compatible commands, use the ADSH_CMD_ARGORDER environment variable.

#4

The ADSH_LANG environment variable is prioritized over the LANG environment variable. If the ADSH_LANG environment variable is not specified, messages are output in the language and encoding specified in the LANG environment variable. If neither the ADSH_LANG environment variable nor the LANG environment variable is specified, the value C is assumed.

#5

The ADSH_LANG_JP1EVENT environment variable takes priority over both the ADSH_LANG and the LANG environment variables.

If the ADSH_LANG_JP1EVENT environment variable is not specified, messages are output in the language specified in the ADSH_LANG environment variable. If neither the ADSH_LANG_JP1EVENT nor the ADSH_LANG environment variable is specified, messages are output in the language specified in the LANG environment variable.

If the ADSH_LANG environment variable is set to a value other than C, or if the ADSH_LANG environment variable is not specified and the LANG environment variable is set to a value other than C, messages that are output by JP1 events are output in Japanese. In such a case, if you want JP1 event messages to be output in English, set the ADSH_LANG_JP1EVENT environment variable to C.

#6

If you execute the adshmdctl command with this environment variable specified, messages to the syslog are also output in the language and encoding specified in the ADSH_LANG environment variable. Depending on the system, outputting the character encodings of the language and encoding to the syslog might be impossible. In this case, do not use the adshmdctl command with this environment variable specified.

#7

If settings are prepared by using the job definition script file or environment file, the specifications will be valid for child jobs and root jobs started from the job definition script and some of the UNIX-compatible commands.

#8

Note the following when setting an option that has a value for the GZIP environment variable:

  • If the value of the option is enclosed in either single quotation marks (') or double quotation marks ("), the quotation marks (' or ") are handled as part of the value of the option.

  • If the value of the option contains any spaces or tab characters, the spaces or tab characters are handled as delimiter characters and multiple arguments are assumed to be specified.

From job definition scripts, you can reference the default environment variables that are set by the OS and the environment variables that are specified in the export parameter in the environment files, in addition to the environment variables listed in the above table. For details about the export parameter, see 7.3.18 export parameter (defines an environment variable).