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.
Printable View
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.
"unset a" will get rid of it. Alternatively, "a=" will empty it so to all intents and purposes it's gone.
Thanks a lot!! :-D