Hitachi

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


return command (returns from a function or an external script)

Organization of this page

Format

return  [n]

Description

This command returns from a function or an external script, then continues processing in the calling function. Note that this command exits the shell if it is executed at a location other than from within a function or an external script.

Regardless of the value of the return code, this command terminates normally or with an error on the basis of whether the command syntax is valid.

If no argument is specified, the command terminates normally with the return code from the command that executed last as the return code. If it executes with a valid numeric value specified as the argument, it terminates normally. If it executes with an invalid value specified as the argument, such as non-numeric characters, it terminates with an error. When this command terminates with an error, it returns 1 as the return code.

Arguments

n ~<unsigned integer>((0 to 255))

Specifies the return code. When this argument is omitted, the command returns with the return code from the command that executed last. If you specify 256 or a greater value for this argument, the command terminates normally with a return code that is the remainder from dividing the specified value by 256. If you specify a negative value, the command terminates normally with a return code that is the two's complement of the specified value.

Return codes

Return code

Meaning

0 to 255

Normal termination

  • Returns the value specified in n or the return code of the command that executed last.

1

Error termination

  • A non-numeric value was specified.

Notes

Usage example