READONLY(1)

NAME

readonly - mark variables as readonly.

SYNOPSIS

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

DESCRIPTION

readonly is a POSIX special builtin provided by Rush. It marks variables as readonly. Assignment operands set a value before applying the attribute. Without operands, it prints readonly declarations.

OPTIONS

-a
Accept Bash-style indexed-array declarations. This option is available only in Rush's default Bash-compatible mode.
-p
Print reusable readonly declarations, optionally restricted to the named variables.
-r
Apply the readonly attribute explicitly.
-x
Also apply the export attribute.
--
End option parsing.

EXIT STATUS

Zero on success, one when a declaration fails, and two for invalid options or, in POSIX mode, invalid identifiers.

SEE ALSO

rush-builtins(7), declare(1), export(1), POSIX Shell Command Language.