Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strange parameter visibility
- X-seq: zsh-workers 39508
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh Hackers' List" <zsh-workers@xxxxxxx>
- Subject: Re: Strange parameter visibility
- Date: Thu, 29 Sep 2016 14:28:21 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=rL3k7NwpcwPWOIxcx+6MnD/IE+o0KGS1xFeJIkT8yi4=; b=NHVAqpYwxidXqvy2fdo0ediUmeFjQpGCpFKVTVBM6kRbslMyJAwcazjkZDn8XZJjRT R4e2+mie5oVVReVcNZ2wvRmB+FuAHy6fInLHnnjgVssCunSD8rOUtUQBE9vbeHE4cN32 BuumX+xrkDbqJYOA1dAhVOelo18VB4LGiueASHRW2dNSUm14zYSj2ygn3kizD1faqysM FsnT2FeRyZAap5Fu1VsBBpy9IjIT9En37i5Y1Uv9qVJj1bHwpCieVFymF8b08MK78L3e mMiLh4D9Mb34ohmrkXWMXNCE4gScJm2LtfKbwZ4OR6IBIiUtiyR115HUBJsfLR91+21u PR3Q==
- In-reply-to: <20160929180301.5d1930d0@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20160917181339eucas1p24d214aa618aa96b5a8ddfbf351598da6@eucas1p2.samsung.com> <87bmzmtmzq.fsf@alfa.kjonca> <20160929172417.5022a014@pwslap01u.europe.root.pri> <20160929180301.5d1930d0@pwslap01u.europe.root.pri>
On Sep 29, 6:03pm, Peter Stephenson wrote:
} Subject: Re: Strange parameter visibility
}
} This appears to be harder.
}
} % unset x
} % : ${x:=2} | echo $x
} 2
}
} In this case, we don't know at the point where we start the pipeline
} whether we're going to be in the current shell or not.
Hrm. But:
% y=3 : ${z:=2} | echo $y $z
%
Why do we know *there* that we should fork before expanding ${z:=2},
when we don't know in the absence of the y=3 prefix? Or is something
completely different happening, e.g., save_params() / restore_params()
that I was looking at before?
Under what circumstances is it possible to do anything useful with a
pipe without forking the left side?
I tried reducing the test that you changed in 39502 to looking at
nothing but (how & Z_SYNC) and the only Test/* to fail are the ones
looking at $pipestatus and setopt pipefail -- and as it happens I
can make the pipefail test fail by using /bin/true and /bin/false
in place of the builtin true and false, so there may be something
deeper wrong there anyway.
==========
0
1
1
-2
+1
Test ./E01options.ztst failed: output differs from expected as
shown above for:
(setopt pipefail
/bin/true | /bin/true | /bin/true
print $?
/bin/true | /bin/false | /bin/true
print $?
exit 2 | /bin/false | /bin/true
print $?
/bin/false | exit 2 | /bin/true
print $?)
Was testing: PIPE_FAIL option
==========
I can also make the $pipestatus test fail (one time in the 2048 loops
it performs) by using "exit 2" instead of "return 2" on the left sides
of the pipelines. (Test/A05execution.ztst)
However, I get those failures on only one of the two hosts where I tried.
So these likely are still some kind of race condition.
} If the command is external we want to keep the current code (not sure
} where this gets hairy otherwise but it does).
Whether the command is external doesn't seem to matter, unless you mean
the command on the right-hand side of the pipe.
} Other cases people find are likely to be similar to this one.
Indeed.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author