Package: bash
Version: 3.1dfsg-7
Severity: normal

"typeset -r" will make a variable readonly.  From bash(1):

                -r   Make names  readonly.  These names  cannot then be
                        assigned    values   by    subsequent   assignment
                        statements or unset.

The man page then goes on to say:

                Using  `+'  instead  of  `-' turns  off  the  attribute
                instead, with the exception that  +a may not be used to
                destroy an  array variable.

This means I should be able to "typeset +r" to undo the "-r", but it doesn't:

------------------------------------------------------------------------
(debian) [EMAIL PROTECTED]:~$ var=xxx
(debian) [EMAIL PROTECTED]:~$ echo $var
xxx
(debian) [EMAIL PROTECTED]:~$ typeset -r var
(debian) [EMAIL PROTECTED]:~$ var=yyy
bash: var: readonly variable
(debian) [EMAIL PROTECTED]:~$ typeset +r var
bash: typeset: var: readonly variable
(debian) [EMAIL PROTECTED]:~$ var=yyy
bash: var: readonly variable
(debian) [EMAIL PROTECTED]:~$ echo $var
xxx
------------------------------------------------------------------------

I don't know if this is a documentation bug or a bash bug, but one or
the other seems to be wrong here.





-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-2-vserver-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)

Versions of packages bash depends on:
ii  base-files                   4           Debian base system miscellaneous f
ii  debianutils                  2.17.3      Miscellaneous utilities specific t
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libncurses5                  5.5-5       Shared libraries for terminal hand

bash recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to