How to remove readonly variable?
Hi,
# var1=super # var1= 1.first i assign var1=super, than i assign var1 to nothing. # var1=super # readonly var1 # var1= -bash: var1: readonly variable # unset var1 -bash: unset: var1: cannot unset: readonly variable 2. Now i assign var1 as readonly variable, than if i really want to change or remove this variable how to do? Thank. |
Quote:
The only chance is to use readonly variables in a subshell. In this case the variable is local to the subshell and the parent shell is not aware of its existence: Code:
( var=3; readonly var; echo $var ) |
All times are GMT -5. The time now is 07:40 PM. |