How to delete readonly variable in bash?

Solution 1:

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.

Solution 2:

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.