![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can unset for "PS4" | koti_rama | UNIX for Dummies Questions & Answers | 1 | 08-05-2007 11:12 PM |
| Readonly access | faruque.ahmed | UNIX for Dummies Questions & Answers | 13 | 01-31-2007 06:25 AM |
| How to unset 'finger' info? | Chanakya.m | Shell Programming and Scripting | 3 | 01-23-2006 06:12 AM |
| Is there any way to set env variable in top level Makefile and unset when done | umen | Shell Programming and Scripting | 0 | 10-23-2005 05:15 AM |
| Making files readonly with vi? | Flyguy | UNIX for Dummies Questions & Answers | 2 | 11-15-2003 03:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Tha man pages for bash says, once a variable is marked as readonly, it cannot be unset.
Code:
typeset -r Make names readonly. These names cannot then be assigned values by subsequent assignment statements or unset. Code:
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.
Code:
[/tmp]$ {(b=8; readonly b; echo "-$b-"); b=90; echo "[$b]"; unset b; echo "[[$b]]";}
-8-
[90]
[[]]
|
|
#3
|
|||
|
|||
|
Thanks Vino...
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|