I can declare a bash variable as read only:
var=myname
declare -r var
and then when I try to change the value :
var=anothername
I get (in zsh for example)
>>read-only variable: var
How can I "undeclare" or unset this variable?
I can declare a bash variable as read only:
var=myname
declare -r var
and then when I try to change the value :
var=anothername
I get (in zsh for example)
>>read-only variable: var
How can I "undeclare" or unset this variable?
You can't in bash, readonly means you can't change that variable in anyway, including getting rid of it.
I found this here unset:
$ cat << EOF| sudo gdb
attach $$
call unbind_variable("var")
detach
EOF