Surely a pipe counts as an explicit redirection?
And even if it didn't, the inconsistency between the first and subsequent asynchronous elements is confusing.
On 1/10/16 12:54 PM, Piotr Grzybowski wrote:
> hey,
>
> I am quite sure it happens here (devel branch, at
> 6f82653c5ef09aeeeba4376a1c65ce86c3605c00):
>
> execute_cmd.c +5115:
> if ((cmdflags & CMD_STDIN_REDIR) &&
> pipe_in == NO_PIPE &&
> (stdin_redirects (redirects) == 0))
> async_redirect_stdin ();
>
> but after reading the comments some 3.5k lines earlier I am not sure
> how to fix it; of course commenting out the if in
> execute_cmd.c:5112-5115 solves it, but who can tell what it breaks?
Posix requires this behavior:
"The standard input for an asynchronous list, before any explicit
redirections are performed, shall be considered to be assigned to a file
that has the same properties as /dev/null."
On 13 Jan 2016 8:14 p.m., "Andreas Schwab" <sch...@suse.de> wrote:
> I don't think so.
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07
> doesn't mention pipelines.
That was rather my point. Given that they aren't mentioned, one has to take them as read, otherwise even ( ( foo 2>&1 ) | bar ) won't work as advertised.