How to delete readonly variable in bash?

You can't delete mySite. The whole point of the readonly command is to make it final and permanent (until the shell process terminates). If you need to change a variable, don't mark it readonly.


Walker Hale IV's solution can be expressed in a much shorter fashion using options available in more recent versions of gdb:

gdb --batch-silent --pid=$$ --eval-command='call unbind_variable("mySite")'

Again, this is dark magic that should be kept well away from production environments.

Tags:

Linux

Shell

Bash