Name

readonly

Synopsis

readonly [-afp] [variable[=value] ...]

Prevent the specified shell variables from being assigned new values. An initial value may be supplied using the assignment syntax, but that value may not be changed subsequently. If no variables are specified, readonly displays a list of variables marked read-only.

Options

-a

Each variable must refer to an indexed array.

-A

Each variable must refer to an associative array.

-f

Each variable must refer to a function.

-p

Display the output in a format that allows the list of read-only variables to be saved for rereading later.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.