Re: Exporting a variable as readonly in ksh

From: Willeat, Todd (TWilleat@MHP.SMHS.COM)
Date: Sat Mar 01 2003 - 09:02:44 EST


That's where I tried it...

-----Original Message-----
From: Adams Kevin J [mailto:kevin.adams@PHS.COM]
Sent: Wednesday, February 26, 2003 6:14 PM
To: aix-l@Princeton.EDU
Subject: Re: Exporting a variable as readonly in ksh

What about from /etc/profile like LOGNAME?

Kevin Adams

-----Original Message-----
From: Willeat, Todd [mailto:TWilleat@MHP.SMHS.COM]
Sent: Wednesday, February 26, 2003 4:04 PM
To: aix-l@Princeton.EDU
Subject: [aix-l] Exporting a variable as readonly in ksh

I'm having a problem getting a variable to keep its readonly attribute.
Here's what I'm doing:

readonly TMOUT=1
export TMOUT

As expected, TMOUT has a value of 1 and you receive a message that it is
readonly if you try to change it. If I now open a new ksh subshell, the
TMOUT variable retains the value of 1 since it was exported. However, in
this subshell the variable is not readonly and can be reset by a user.

Is there any way to get the variable to be readonly in any subshell as well?

               _______________________________________
              / Todd A. Willeat \
             | UNIX Administrator |
             | Mercy Health Plans |
             | 425 South Woods Mill Road |
           _ | Chesterfield, Missouri 63017-3492 | _
          / )| (314) 214-2329 / (314) 214-8202 (fax) |( \
         / / | twilleat@mhp.mercy.net | \ \
       _( (_ | http://www.mercyhealthplans.com/ | _) )_
      (((\ \> \/->___________<-=-=-=-=->___________<-\/ </ /)))
      (\\\\ \_/ / \ \_/ ////)
       \ / \ /
        \ _/ \_ /
        / / \ \
       /___/ \___\

This e-mail contains information which (a) may be PROPRIETARY IN NATURE OR
OTHERWISE PROTECTED BY LAW FROM DISCLOSURE, and (b) is intended only for the
use of the addressee (s) named above. If you are not the addressee, or the
person responsible for delivering this to the addressee (s), you are hereby
notified that reading, copying or distributing this e-mail is prohibited. If
you have received this e-mail in error, please contact the sender
immediately.

This electronic message transmission, including any attachments, contains
information from PacifiCare Health Systems Inc. which may be confidential or
privileged. The information is intended to be for the use of the individual
or entity named above. If you are not the intended recipient, be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited.

If you have received this electronic transmission in error, please notify
the sender immediately by a "reply to sender only" message and destroy all
electronic and hard copies of the communication, including attachments.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:37 EDT