Thursday, May 3, 2007
Sometime a need may arise for variables to have a constant or fixed value.
A very simple script to state the same.
$ cat readonly.sh
echo "Trying to set \"a\" to a diff value"
A Sample run:
Trying to set "a" to a diff value
readonly: line 6: a: readonly variable
From the shell the readonly variables can be listed using "readonly" command.
© Jadu Saikia www.UNIXCL.com