Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA
readonly var=value prevent shell scripter changing value of variable var,
there is no restriction for the shell itself.
Try:
set -o posix
readonly | grep SHELLOPTS
and:
set +o posix
readonly | grep SHELLOPTS
to see the missing of `posix` in 2nd command, the readonly variable
SHELLOPTS was
I tested on
4.2.45(1)-release
basically I have tested
nerdopolis@nerdopolis:~$ readonly POSIXLY_CORRECT=1
nerdopolis@nerdopolis:~$ set +o posix
nerdopolis@nerdopolis:~$ echo $POSIXLY_CORRECT
nerdopolis@nerdopolis:~$
Although I will admit I'm not sure if it's supposed to do that or not