Hitachi

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


6.2.10 Executing a function (finish command)

The finish command executes the job definition script until control is returned from a function. The abbreviation for the finish command is f. The following shows the format of the finish command:

finish

The following describes the finish command's processing.

When no argument is specified in the finish command

When execution is stopped within a function, this command outputs a message indicating that execution will resume through the end of the current function, and then resumes execution of the job definition script through the end of the function. When execution of the job definition script stops, the command displays the frame information for the stop location, and then displays the next line number scheduled to be executed and the line in the source file. The following shows the display format for the frame information at the stop location.

Frame information at the stop location
Num  Function  File:Line
frame-number  function-name  file-name:line-number
  • frame-number: Indicates the frame number (0 is always displayed).

  • function-name: Indicates the name of the function corresponding to the frame information to which the name of the job definition script calling the function is attached. If no function has been called, <main> is displayed as the function name. A maximum of 63 bytes can be displayed.

  • file-name: Indicates the name of the file in which execution is currently stopped.

  • line-number: Indicates the line number at which execution is currently stopped.

    If execution is stopped at the end of the job definition script, <EOF> is displayed. If execution is stopped while the trap command's action is executing, <Trap action> is displayed.

If execution is stopped without having entered a function or if the job definition script is not running, the command outputs an error message.

When an argument is specified in the finish command

Executing the command results in an error.

Notes:

If a stop evaluation condition is satisfied by a breakpoint, a watchpoint, or a signal at a subsequent line in the function, the command stops execution of the job definition script.

Example

If the finish command is executed while execution is stopped before echo on line 2, the command stops execution before echo on line 9 and displays the frame information.

1: funcA(){
2:   echo "funcA"
3:   num=10
4: }
5:
6: val=1
7: num=2
8: funcA
9: echo $num
 
2:   echo "funcA"
Current: echo
(adshdb) finish
KNAX7036-I Execution will continue until the end of the current function.
...
Num  Function  File:Line
0    <main>    test.ash:9
KNAX7032-I The script "test.ash" stopped running.
9: echo $num
Current: echo
(adshdb)