Hitachi

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


let command (evaluates the values of arithmetic expressions)

Organization of this page

Format 1

let arithmetic-expression[,arithmetic-expression ... ]

Format 2

((arithmetic-expression))

Description

This command performs numeric calculations in order to evaluate specified arithmetic expressions.

In addition to using the let command, you can also calculate the result of an arithmetic expression using the syntax ((arithmetic-expression)), and the results will be evaluated in the same way as for the let command.

The let command accepts multiple arithmetic expressions delimited by the comma (,). If you specify more than one arithmetic expression, they are calculated in order from left to right. As a result, if you use a conditional expression to evaluate a comma-separated list of arithmetic expressions, a conditional is evaluated taking into account the result of the arithmetic expression that was executed last. Note that specifying any spaces before or after a delimiter comma results in termination of the command with an arithmetic error. You can group calculations in parentheses in order to change the priority of operations.

For details about arithmetic expressions, see 5.3 Arithmetic operations. For details about conditionals, see 5.2 Conditionals.

Return codes

Return code

Meaning

0

Normal termination

  • The value of the arithmetic expression is not 0.

1

Normal termination

  • The value of the arithmetic expression is 0.

  • The syntax (( )) executed but no arithmetic expression was specified.

Error termination

  • The let command executed but no arithmetic expression was specified.

2

Error termination

  • An arithmetic error occurred (division by zero, invalid arithmetic expression).

Notes

Usage examples