Hi Jakub,

On 2014-06-20 14:32, Jakub Wilk wrote:
[I'm not the maintainer of bash.]

* Filipus Klutiero <chea...@gmail.com>, 2014-01-12, 14:59:
A pipeline terminated by an ampersand causes the pipeline to be executed 
asynchronously. Understandably, this means variable assignments may not persist 
immediately. However, in my environment and others (hence the upstream tag), 
asynchronous variable assignment is in fact completely broken:

$ BAR=a echo $BAR &
[1] 24144
chealer@vinci:/var/log/apt$

[1]+  Done                    BAR=a echo $BAR
chealer@vinci:/var/log/apt$

I don't think what you're observing has anything to do with ampersands. You get 
the same behavior without them:

$ BAR=a echo $BAR nothing
nothing

This is also how all other shells I know behave, so I doubt it's a bug.


That's indeed not a bug:
If no command name results, the variable assignments affect the current shell 
environment. Otherwise, the variables are added to the environment of the 
executed command and do not affect the current shell environment.

--
Filipus Klutiero
http://www.philippecloutier.com


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to