[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readonly variables

From: ANDONE Mures
Subject: readonly variables
Date: Tue, 8 Apr 2003 14:22:43 +0300

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-I./lib -O2 -march=i386 -mcpu=i686
uname output: Linux fenrir.info.uaic.ro 2.4.19-bbp10-2 #3 SMP Thu Mar 6 
08:35:48 EET 2003 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

        removing the "readonly" flag of a variable does not work!


        declare -r VAR="10"
        echo $VAR               #outputs "10"
        readonly -n VAR         #silently does nothing
        echo $VAR               #outputs "10", as expected
        VAR=11                  #ERROR!!!! VAR : readonly variable!! WHY???
        declare +r VAR          #The same ERROR!!! VAR: readonly variable...

  WHY ??????

reply via email to

[Prev in Thread] Current Thread [Next in Thread]