how to unset the readonly variable

Hi All,

May be this is a very simple question...

[trainee@Venus trainee]$ b=8
[trainee@Venus trainee]$ readonly b
[trainee@Venus trainee]$ echo $b
8
[trainee@Venus trainee]$ b=90
-bash: b: readonly variable
[trainee@Venus trainee]$ unset b
-bash: unset: b: cannot unset: readonly variable

I m not able to change the readonly mode of variable b
Please help me out..

Thanks
Nidhi

Tha man pages for bash says, once a variable is marked as readonly, it cannot be unset.

             typeset -r     Make names readonly.  These names cannot then be  assigned values by subsequent assignment statements or unset.

Also unset says

       unset [-fv] [name ...]
              For each name, remove the corresponding variable or function.  If
              no  options  are  supplied,  or the -v option is given, each name
              refers to a shell  variable.   Read-only  variables  may  not  be
              unset.  

Your best option would be to kill the shell, or run the commands within a subshell. Something like

[/tmp]$ {(b=8; readonly b; echo "-$b-"); b=90; echo "[$b]"; unset b; echo "[[$b]]";}
-8-
[90]
[[]]

Thanks Vino...