Greg Wooledge wrote:
> Jim Meyering wrote:
> > Is there a moral here, other than to avoid using special variable names?
> > Probably to prefer lower-case variable names.
>
> You've nailed it. Or more precisely, avoid all-upper-case variable names,
> because they tend to collide with environment v
On 03/07/2012 04:54 PM, Jim Meyering wrote:
FYI, if I attempt to read into the built-in array variable, GROUPS,
this doesn't work:
$ bash -c 'while read GROUPS; do echo $GROUPS; done< /etc/passwd'|wc -l
0
Comparing with dash, I see what the author expected, i.e.,
that the while loop iter
On Wed, Mar 07, 2012 at 04:54:14PM +0100, Jim Meyering wrote:
> Is there a moral here, other than to avoid using special variable names?
> Probably to prefer lower-case variable names.
You've nailed it. Or more precisely, avoid all-upper-case variable names,
because they tend to collide with envi
FYI, if I attempt to read into the built-in array variable, GROUPS,
this doesn't work:
$ bash -c 'while read GROUPS; do echo $GROUPS; done < /etc/passwd'|wc -l
0
Comparing with dash, I see what the author expected, i.e.,
that the while loop iterates once per line in /etc/passwd:
$ dash -c