readonly ( 1 ) USER COMMANDSreadonly ( 1 )


NAME

readonly - set readonly attribute on variables

SYNOPSIS

readonly [ options ] [name[=value]...]

DESCRIPTION

readonly sets the readonly attribute on each of the variables specified by name which prevents their values from being changed. If =value is specified, the variable name is set to value before the variable is made readonly.

If no names are specified then the names and values of all readonly variables are written to standard output.

readonly is built-in to the shell as a declaration command so that field splitting and pathname expansion are not performed on the arguments. Tilde expansion occurs on value.

OPTIONS

-p
Causes the output to be in a form of readonly commands that can be used as input to the shell to recreate the current set of readonly variables.

EXIT STATUS

0
Successful completion.
>0
An error occurred.

SEE ALSO

sh(1), typeset(1)

IMPLEMENTATION

version
readonly (AT&T Research) 1999-07-07
author
David Korn <dgk@research.att.com>
copyright
Copyright © 1982-2008 AT&T Intellectual Property
license
http://www.opensource.org/licenses/cpl1.0.txt