Results 1 to 3 of 3
Occasionally some stupid things come to mind. This is one of them.
Suppose we read a shell variable like this:
Code:
$ read a
12
$ echo $a
12
How ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-01-2008 #1
Removing a shell variable
Occasionally some stupid things come to mind. This is one of them.
Suppose we read a shell variable like this:
How can I delete this variable "a" now, without logging out or rebooting?Code:$ read a 12 $ echo $a 12
Thanks in advance.
- 01-01-2008 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
"unset a" will get rid of it. Alternatively, "a=" will empty it so to all intents and purposes it's gone.
- 01-02-2008 #3


Reply With Quote
