You can develop, debug, and run shell scripts online. The developed scripts can be run in jobs. For details, see Developing a Job.
Parameter |
Description |
Example |
---|---|---|
Host Connection |
Selects the host where a shell script is to be executed. |
N/A |
Parameter |
Parameter transferred to the Shell script when it is executed. Parameters are separated by spaces, for example, a b c. The parameter must be referenced by a location variable (for example, $1, $2, or $3) in the Shell script. Otherwise, the parameter is invalid. The location variable starts from 0. Variable 0 is reserved for storing the actual script name, variable 1 corresponds to the first parameter of the script, and so on. For example, $1, $2, and $3 reference parameters a, b, and c, respectively. Note: If a variable is referenced in the shell script, use the $args format instead of the ${args} format. Otherwise, the variable will be replaced by a parameter with the same name in the job. |
For example, if you enter a b c and run the following Shell script, b is displayed: echo $2 |
Interactive Input |
Interactive information (for example, passwords) provided during shell script execution. |
For example, run the following interactive Shell script. Interaction parameters 1, 2, and 3 correspond to begin, end, and exit, respectively.
#!/bin/bash select Actions in "begin" "end" "exit" do case $Actions in "begin") echo "start something" break ;; "end") echo "stop something" break ;; "exit") echo "exit" break ;; *) echo "Ignorant" ;; esac done |
a=1 echo ${a}
In the preceding command, a indicates the parameter name. It can contain only letters, digits, hyphens (-), underscores (_), greater-than signs (>), and less-than signs (<), and can contain a maximum of 16 characters. The parameter name must be unique.
Note: If a variable is referenced in the shell script, use the $args format instead of the ${args} format. Otherwise, the variable will be replaced by a parameter with the same name in the job.
Parameter |
Mandatory |
Description |
---|---|---|
Script Name |
Yes |
Name of the script. It contains a maximum of 128 characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. |
Description |
No |
Descriptive information about the script. |
Select Directory |
Yes |
Directory to which the script belongs. The root directory is selected by default. |