1822543 Members
2755 Online
109642 Solutions
New Discussion юеВ

ksh typeset -r

 
SOLVED
Go to solution
System Unix
Frequent Advisor

ksh typeset -r

Hi,

is there a wat to unset a variable that was assisgned with typeset -r ?

the +r still gives the readonly message.

thanks,
Reuven
Reuven
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: ksh typeset -r

Hi Reuven:

This is a one-way street. If you could reassign to the variable or unset it, then it wouldn't be read-only :-)

Regards!

...JRF...
System Unix
Frequent Advisor

Re: ksh typeset -r

Hi James,

What you mean is that actually you will not be able to set or unset it conditionly, and have to use another var name ?

tnx,
Reuven
Reuven
James R. Ferguson
Acclaimed Contributor
Solution

Re: ksh typeset -r

Hi (agin) Reuven:

> What you mean is that actually you will not be able to set or unset it conditionly, and have to use another var name ?

Yes.

Regards!

...JRF...
System Unix
Frequent Advisor

Re: ksh typeset -r

thanks,James
Reuven
Dennis Handly
Acclaimed Contributor

Re: ksh typeset -r

>is there a way to unset a variable that was assigned with typeset -r ?

As mentioned by JRF, the only way to do this is to exit the shell and start over.
Even subshells have magic protection but are easily hacked.
System Unix
Frequent Advisor

Re: ksh typeset -r

thanks Dennis.
Reuven