Thursday 26 July 2018

linux - How to delete readonly variable in bash?


$ mySite="superuser"
$ readonly mySite
$ unset mySite
bash: unset: mySite: cannot unset: readonly variable

How can we delete mySite, as it is a readonly variable?



Answer



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.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...