Hitachi

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


3.2.4 Specifying what is to be executed by a job from the command line

If you use the -r option of the adshexec command to specify on the command line any commands that can be described in a job definition script file, such as standard shell commands and UNIX-compatible commands, you can execute the commands without having to create a job definition script file. To specify the pwd command, which is a standard shell command, on the command line, execute the following adshexec command:

adshexec -r pwd

You can specify on the command line any contents that can be described in a job definition script file, such as multiple commands delimited by the command separator. The following adshexec command specifies multiple commands on the command line:

adshexec -r "export DATA=file01 ; pgm001"

If you specify any spaces on the command line, you must enclose the command line specification in single or double quotation marks (' or "). Because metacharacters, such as $, *, and the semicolon (;), are expanded, depending on the shell used to execute the adshexec command, you must enclose them in single or double quotation marks (' or ") or use an escape character (\). To specify metacharacters, execute the adshexec command as follows:

In UNIX:

[Figure] When an escape character is specified

[Figure] Entered command:
adshexec -m MINIMUM -r "A=(1 2 3); echo \${A[@]}"
[Figure] Output results:
1 2 3

[Figure] When no escape character is specified

[Figure] Entered command:
adshexec -m MINIMUM -r "A=(1 2 3); echo ${A[@]}"
[Figure] Output results:

Nothing is output.

[Figure] Output of positional parameter $0 (when an escape character is specified)

[Figure] Entered command:
adshexec -m SIMPLE -r "echo \$0"
[Figure] Output results:
adshexec

[Figure] Output of positional parameter $0 (when no escape character is specified)

[Figure] Entered command:
adshexec -m SIMPLE -r "echo $0"
[Figure] Output results:
-bash

adshexec receives the contents obtained by converting positional parameter $0 by the login shell. If the login shell is bash, -bash is output.

In Windows:

[Figure] When an escape character is specified

[Figure] Entered command:
adshexec -m MINIMUM -r "A=(1 2 3); echo \${A[@]}"
[Figure] Output results:
${A[@]}

[Figure] When no escape character is specified

[Figure] Entered command:
adshexec -m MINIMUM -r "A=(1 2 3); echo ${A[@]}"
[Figure] Output results:
1 2 3

[Figure] Output of positional parameter $0 (when an escape character is specified)

[Figure] Entered command:
adshexec -m SIMPLE -r "echo \$0"
[Figure] Output results:
$0

[Figure] Output of positional parameter $0 (when no escape character is specified)

[Figure] Entered command:
adshexec -m SIMPLE -r "echo $0"
[Figure] Output results:
adshexec

Note the following about executing the adshexec command with the -r option specified: