bug-bash
[Top][All Lists]
Advanced

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

Re: "GROUPS" is read-only, but only sort of


From: Chet Ramey
Subject: Re: "GROUPS" is read-only, but only sort of
Date: Fri, 3 Nov 2000 13:04:07 -0500

> [jik@jik installer]$ echo $BASH_VERSION
> 2.04.4(1)-release
> [jik@jik installer]$ GROUPS=foo
> [jik@jik installer]$ echo $GROUPS; GROUPS=foo; echo $GROUPS
> 3009
> foo
> 
> There are two different problems here:
> 
> 1) It is exceedingly bogus that attempts to modify the GROUPS variable
> are silently ignored.  If bash is going to make the variable
> read-only, then it should make the variable read-only, darn it, and
> attempts to assign values to it should cause an errors.  I spent hours
> and hours tracking down wrong behavior in a script which used a
> variable named GROUPS and couldn't understand why it wasn't getting
> set properly.

The current behavior is documented.

GROUPS was originally readonly.  People complained that they could not even
unset it (since readonly variables can't be unset), and that screwed up
their scripts.  I received multiple complaints about the oracle install
script, for one.

The current behavior is a compromise.  GROUPS is essentially readonly,
but may be unset.

> 2) Bash isn't even consistent about enforcing the read-only
> restriction on this variable.  As shown above, after you echo it once,
> you can change its value.  I assume that this behavior is
> unintentional?

That's a bug that's already been fixed.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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