#735117 [bash] Variable assignment has no effect in asynchronous pipelines

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Filipus Klutiero
Date:
2014-06-21 01:48:05 UTC
Severity:
normal
#735117#5
Date:
2014-01-12 19:59:19 UTC
From:
To:
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:


Debian Release: jessie/sid
990 testing http.us.debian.org
500 unstable http.us.debian.org
1 experimental debian.mirror.iweb.ca
--- Package information. ---
Depends (Version) | Installed
===========================-+-============
base-files (>= 2.1.12) | 7.2
debianutils (>= 2.15) | 4.4


Recommends (Version) | Installed
===================================-+-================
bash-completion (>= 20060301-0) | 1:2.1-2


Suggests (Version) | Installed
=======================-+-===========
bash-doc |

#735117#8
Date:
2014-06-20 18:32:33 UTC
From:
To:
[I'm not the maintainer of bash.]

* Filipus Klutiero <chealer@gmail.com>, 2014-01-12, 14:59:

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.

#735117#13
Date:
2014-06-21 01:44:12 UTC
From:
To:
Hi Jakub,

That's indeed not a bug: