Hitachi

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


readonly command (sets the read-only attribute for variables or displays all read-only variables)

Organization of this page

Format

readonly  [-p] [name [=value]...]

Description

This command sets the read-only attribute for specified variables or displays all read-only variables. When the command is executed with no options, it outputs to the standard output the names of all the read-only variables.

To revert a variable's read-only attribute back to writable, specify the +r option to the typeset command.

Arguments

-p

Specifies that all read-only variables are to be output to the standard output in the format readonly variable-name=value. However, if you specify the -p option and name at the same time, the read-only attribute is set for the specified variable.

name

Specifies the name of a variable for which the read-only attribute is to be set.

More than one variable name or array name can be specified. However, if a function name is specified in name, the read-only attribute is not set for the function, instead the read-only attribute is set for a variable with the same name as the specified function.

If an array name is specified in name, the read-only attribute is set for all the elements that constitute the array. Even if you specify one element of an array, the read-only attribute is set for all the elements of the array.

If there is no variable with the specified name, such a variable is created, and the read-only attribute is set for it. In such case, if no value is specified for the attribute, the linefeed character is set as the new attribute's value and it has the read-only attribute.

If the read-only attribute is already set for the specified variable, the command terminates normally without doing anything.

value

Specifies a value to be set for the specified variable.

The specified value is set for the variable when name is followed by =value. If no value is specified, the read-only attribute is set for the specified variable without changing its value.

Return codes

Return code

Meaning

0

Normal termination

1

Error termination

Notes

Usage example