Korn Shell: Unix and Linux Programming Manual, Third Edition, The By Anatole Olczak
Table of Contents
Chapter 9. Miscellaneous Commands
The readonly Command
The readonly command sets the value and/or readonly attribute of variables. It is equivalent to the typeset r command, except that when used within a function, a local variable is not created. This command sets X to readonly and assigns it a value of 1:
$ readonly X=1
This is equivalent to:
$ typeset r X=1
Multiple variables can be given to the readonly command.
$ readonly X Y=1 Z=2
If no arguments are given, a list of readonly variables and their values is displayed: