Operating System - HP-UX
1825689 Members
3562 Online
109686 Solutions
New Discussion

How to unset a readonly variable?

 
tikual
Advisor

How to unset a readonly variable?

Hi all,

After I typed "typeset -r var1", how can I unset var1?

Thanks.
3 REPLIES 3
Mark Grant
Honored Contributor

Re: How to unset a readonly variable?

you can type "unset var1"

Nearly solved it yourself there :)
Never preceed any demonstration with anything more predictive than "watch this"
Mark Grant
Honored Contributor

Re: How to unset a readonly variable?

Actually, I appear to be completely wrong!

unset doesn't work

Apologies
Never preceed any demonstration with anything more predictive than "watch this"
Mark Grant
Honored Contributor

Re: How to unset a readonly variable?

Ok, having looked into this a bit in an effort to redeem myself :)

There is no way to change the attribute once it is set. However, some versions of the Korn shell do allow you to unset it and then re-set it but current versions of Korn shell and Posix shell don't allow it.

Sorry!
Never preceed any demonstration with anything more predictive than "watch this"