The readonly Command

   

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:

 $ readonly  Z=1  Y=1  Z=2  PPID=175 

       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net