On 22/5/20 12:49 pm, toybox-requ...@lists.landley.net wrote:

Message: 2
Date: Thu, 21 May 2020 17:50:49 -0500
From: Rob Landley <r...@landley.net>
To: chet.ra...@case.edu, enh <e...@google.com>
Cc: toybox <toybox@lists.landley.net>
Subject: Re: [Toybox] Would someone please explain what bash is doing
        here?
Message-ID: <713fa4a5-28ad-6664-7696-e1ddd7878...@landley.net>
Content-Type: text/plain; charset=utf-8

On 5/20/20 8:39 AM, Chet Ramey wrote:
On 5/19/20 4:03 PM, Rob Landley wrote:
On 5/18/20 10:41 AM, Chet Ramey wrote:
On 5/17/20 7:11 AM, Rob Landley wrote:
I had a reply window open to this when my laptop battery died, and thunderbird
doesn't store unfinished messages like kmail and vi and chrome...

Anyway, I was reminded of this thread by:

   $ IFS=x; ABC=cxd; for i in +($ABC); do echo =$i=; done
   =+(c=
   =d)=
   $ bash -c 'IFS=x; ABC=cxd; for i in +($ABC); do echo =$i=; done'
   bash: -c: line 0: syntax error near unexpected token `('
   bash: -c: line 0: `IFS=x; ABC=cxd; for i in +($ABC); do echo =$i=; done'
   $ readlink -f /proc/$$/exe
   /bin/bash

Yes, you need extglob to get a word like +(xyz) to parse unquoted. Since
the word list following `in' is subject to pathname expansion, it's valid
in that context.

But the same command line in the current shell and in bash -c are parsing
different despite presumably reading the same .bashrc and friends?

My guess is that the interactive shell has extglob enabled somehow, whether
it was in .bashrc or interactively after it was started. The -c command
shell doesn't read startup files, so that doesn't matter.

Mine too, but grep isn't finding extglob under /etc or ~/.*

? from inside /etc/bash.bashrc

/cut

regards
scsijon
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to