Re: rewriting a readonly var should exit

2015-12-15 Thread Andreas Schwab
Aurelien ROUGEMONT writes: > Description: > in the posix shell specification [1] when a script tries to to > overwrite a readonly variable it should crash the script. > > Repeat-By: > #!/bin/bash > readonly rovar="goodvalue" > rovar="badvalue" >

Re: rewriting a readonly var should exit

2015-12-15 Thread John McKown
Are you running BASH in POSIX mode? That's a option. Example: [tsh009@it-johnmckown-linux junk]$ cat ro.sh #!/bin/bash readonly x="x" x="y" echo "sno" [tsh009@it-johnmckown-linux junk]$ ./ro.sh ./ro.sh: line 3: x: readonly variable sno [tsh009@it-johnmckown-linux junk]$ vim ro.sh

Re: rewriting a readonly var should exit

2015-12-15 Thread Aurelien ROUGEMONT
On 12/15/2015 03:39 PM, Andreas Schwab wrote: > Aurelien ROUGEMONT writes: > >> Description: >> in the posix shell specification [1] when a script tries to to >> overwrite a readonly variable it should crash the script. >> >> Repeat-By: >> #!/bin/bash >>

rewriting a readonly var should exit

2015-12-15 Thread Aurelien ROUGEMONT
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'

Re: rewriting a readonly var should exit

2015-12-15 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/15/15 6:12 AM, Aurelien ROUGEMONT wrote: > Bash Version: 4.3 > Patch Level: 30 > Release Status: release > > Description: > in the posix shell specification [1] when a script tries to to > overwrite a readonly variable it should crash