readonly — Shell Built-in Function to Protect the Value of the Given Variable from Reassignment

Synopsis

sh
readonly [name...] 
ksh
** 
readonly [name[=value]]... 

Description

Bourne Shell

The names you specify are marked readonly, and the values of the names cannot be changed by subsequent assignment. If you specify no arguments, a list of all readonly names is printed.

Korn Shell

The given names are marked readonly and cannot be changed by subsequent assignment.

For the readonly command, ksh(1) commands that are preceded by one or two asterisks (*) are treated specially in the following ways.

  • Variable assignment lists preceding the command remain in effect when the command completes.

  • I/O redirections are processed after variable assignments. ...

Get Solaris™ 7 Reference 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.