[Top][All Lists]

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

Re: Reverse redirection / assignment order

From: Dan Douglas
Subject: Re: Reverse redirection / assignment order
Date: Sun, 13 Jan 2013 17:31:45 -0600
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

On Sunday, January 13, 2013 04:54:59 PM Chet Ramey wrote:
> On 1/9/13 2:00 PM, Dan Douglas wrote:
> > When expanding simple commands, steps 3 and 4 are reversed unconditionally 
> > for
> > all command types and number of words expanded, even in POSIX mode.
> > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01
> True.  Bash has always behaved like this.  It's not clear what practical
> consequences it has, other than being technically non-standard, since
> redirections do not have access to variables set in the temporary
> environment.

Yeah... I think I noticed this in trying to figure out what goes on with the
environment of a redirection. There's that "command" thing with IFS a few mails
back. And then there are some other leaky bits. I ran a bunch of experiments
months ago while trying to document the expansion process in more detail.

Just one example still with the most recent patch:

$ bash -c 'x=1; x=2 true <&0$(eval echo \$x $x >&2)'
2 1

I think you solved some problems in the last patch (the IFS in a process
substitution in a redirect glitch). And some probably have to do with all this
http://article.gmane.org/gmane.comp.standards.posix.austin.general/1927 (I had
to re-read that discussion several times.)

Dan Douglas

reply via email to

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