Hitachi

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


5.6.1 Shell options that can be specified with the set command

The following table lists and describes the shell options that can be specified with the set command. For details about the set command, see set command (sets shell options, creates an array, or displays variable values) in 9.3 Standard shell commands.

Table 5‒34: Shell options that can be specified with the set command

Name

Specification method

Meaning when the shell option is specified

Default value

allexport#1

-a

-o allexport

Automatically exports all variables.

Disabled

braceexpand

-o braceexpand

Enables brace expansion. Brace expansion means expanding to multiple words the portion enclosed in curly brackets ({}). Each of the comma-separated words enclosed in curly brackets is expanded as a single variable by adding to it the characters that precede and follow the curly brackets. For example, a{1,2,3} is expanded to a1, a2, and a3.

Enabled

bgnice#2

-o bgnice

Lowers the priority for background jobs.

Disabled

noglob

-f

-o noglob

Prohibits file name substitution. For details about file name substitution, see 5.1.6(6) Substitution.

This shell option also prohibits brace expansion. To enable brace expansion, disable the noglob shell option. For details about how to disable the shell options, see set command (sets shell options, creates an array, or displays variable values) in 9.3 Standard shell commands.

Disabled

nounset

-u

-o nounset

If no value is set in a variable subject to substitution, the job terminates with an error and the shell terminates.

Disabled

verbose#3

-v

-o verbose

Reads the shell input lines and outputs them to the standard error output. The input lines are output before they are analyzed or executed.

Disabled

xtrace

-x

-o xtrace

Sets the value of shell variable PS4 at the beginning of the line and then outputs the executed command and its arguments to the standard error output. Note that this shell option does not output the [[]] command, extended script commands, or their arguments. An arithmetic operation using (( )) is replaced with the let command and then is output.

Disabled

#1

If the VAR_ENV_NAME_LOWERCASE DISABLE environment setting parameter is specified in the Windows edition, any variable whose name contains lowercase letters cannot be exported. If shell variables containing lowercase letters are defined or their values are updated after the allexport shell option has been enabled, an error message is output and the batch job terminates.

#2

Not supported in a Windows execution environment.

#3

When you specify the verbose option in the set command, the output destination for the input lines of a job step definition command is changed.

  • #-adsh_step_start command

    When the #-adsh_step_start command is executed, the input lines for #-adsh_step_start itself are output to STDERR for the job because STDERR is switched from job to job step.

  • #-adsh_step_end command

    When the #-adsh_step_end command is executed, the input lines for #-adsh_step_end itself are output to STDERR for the job step because STDERR is switched from job step to job.

The following shows an example.

Job definition script
  set -o verbose       <-- Or set -v.
 
  #-adsh_step_start S1
    cmdA
  #-adsh_step_error
    cmdB
  #-adsh_step_end
    cmdC
STDERR for job
  #-adsh_step_start S1
    cmdC
    :
STDERR for job step S1
    cmdA
  #-adsh_step_error
    cmdB
  #-adsh_step_end
Notes:

When run-time parameters and JP1/Advanced Shell Editor are used to debug job definition scripts, the command execution results are output to the standard error output. If the set command with the verbose option specified is used, a message containing the command execution results is output after the contents of the next line have been output. The following shows an example.

Job definition script
  001:  set -o verbose
  002:  echo "Line 002"
  003:  echo "Line 003"
The following shows an output example during debugging:
KNAX7018-I Breakpoint "1": filename="test.ash" line=1
KNAX7032-I The script "test.ash" stopped running.
1: set -o verbose
Current: set
(adshdb) step <-- Execute the set command on line 001 of the job definition script.
echo "Line 002" <-- Output the contents of line 002 of the job definition script.
KNAX6112-I Execution of the command set (line=1) finished successfully. exit status=0 execution time=0.000s CPU time=0.000s <-- Output the results of the set command on line 001 of the job definition script.
KNAX7032-I The script "test.ash" stopped running.
2: echo "Line 002"
Current: echo
(adshdb) step
Line 002
        :