6.2.8 Performing sequential execution (step and next commands)
The step and next commands are used to execute the first command from the location at which execution of the job definition script is stopped. If a function is called by the command where execution has stopped, the step command enters the function (performs sequential execution within the function), while the next command executes the processing without stopping inside the function. The abbreviations for the step and next commands are s and n, respectively.
- Organization of this subsection
(1) step command
The following shows the format of the step command:
step
The following describes the step command's processing.
- When no argument is specified in the step command
-
When the step command is executed while execution of the job definition script is stopped, the step command executes the first command from the location where execution of the job definition script has stopped. If a function is called, the step command enters the function (and performs sequential execution within the function).
If the job definition script is not running, the command outputs an error message.
- When an argument is specified in the step command
-
Executing the command results in an error.
- Notes:
-
If a function call is specified in the argument of the eval standard shell command and sequential execution is performed on the eval command, the stop location after execution of the function call depends on the step command's processing.
- Example
-
If the step command is executed while execution is stopped before val=1 on line 6, execution stops before num=2 on line 7.
1: funcA(){ 2: echo "funcA" 3: num=10 4: } 5: 6: val=1 7: num=2 8: funcA 9: echo $num 6: val=1 Current: val=1 (adshdb) step ... KNAX7032-I The script "test.ash" stopped running. 7: num=2 Current: num=2 (adshdb)
If the step command is executed while execution is stopped before funcA on line 8, execution stops before echo on line 2.
8: funcA Current: funcA (adshdb) step KNAX7032-I The script "test.ash" stopped running. 2: echo "funcA" Current: echo (adshdb)
(2) next command
The following shows the format of the next command:
next
The following describes the next command's processing.
- When no argument is specified in the next command
-
When the next command is executed while execution of the job definition script is stopped, the next command executes the first command from the location where execution of the job definition script has stopped. If a function is called, the next command does not stop execution inside the function.
If the job definition script is not running, the command outputs an error message.
- When an argument is specified in the next command
-
Executing the command results in an error.
- Notes:
-
-
When the next command is executed and a function is called by the subsequent command, execution of the job definition script is stopped if a stop evaluation condition is satisfied by a breakpoint, a watchpoint, or a signal within that function.
-
If a function call is specified in the argument of the eval standard shell command and sequential execution is performed on the eval command, the stop location after execution of the function call depends on the next command's processing.
-
- Example
-
If the next command is executed while execution is stopped before val=1 on line 6, execution stops before num=2 on line 7.
1: funcA(){ 2: echo "funcA" 3: num=10 4: } 5: 6: val=1 7: num=2 8: funcA 9: echo $num 6: val=1 Current: val=1 (adshdb) next ... KNAX7032-I The script "test.ash" stopped running. 7: num=2 Current: num=2 (adshdb)
If the next command is executed while execution is stopped before funcA on line 8, execution stops before echo on line 9.
8: funcA Current: funcA (adshdb) next funcA ... KNAX7032-I The script "test.ash" stopped running. 9: echo $num Current: echo (adshdb)