Unset readonly variable in bash
问题 how to unset readonly variable in Bash? $ readonly PI=3.14 $ unset PI bash: PI: readonly variable or is it not possible? 回答1: Actually, you can unset a readonly variable . but I must warn that this is a hacky method. Adding this answer, only as information, not as a recommendation. Use it at your own risk. Tested on ubuntu 13.04, bash 4.2.45. This method involves knowing a bit of bash source code & it's inherited from this answer. $ readonly PI=3.14 $ unset PI -bash: unset: PI: cannot unset: