Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups
- X-seq: zsh-workers 42528
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups
- Date: Sun, 25 Mar 2018 08:38:53 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=m+EBy/vRAdcfy4kbQTtJFYzg82WF3PCTbbEkJIKUMz4=; b=PwulIEVQam2tpO+roVXf2zlGDxlhY5IYQbJKmOo78AvRi14foftrJ3VF4Q0tcIK+rE ihJkAiYvNg0bVv5Fx4emHo9wCExZ3YJyANQAGqwv0OugF6FVxIF4Dyj/H0ygz7LrRw3Y VFGnOvhQYiK2hvKu9O1ttiGJBAJ9n0qGZOyq/lF9nvQALkoHqekbBlq6VCTs1+J1lgQh iWnWb+XgvA2oKlO6aYIuyPE94pmOat6nB/TcIjAgkGXRSJukPO03VxkkAnI2Xvojb0Yb BxtK0cw0J2xXgk1dGmzk6bylNAEZa2oJfHgBhVzxL+a/RKPQjVv/Hn+FijKpMwwxNceK A9LQ==
- In-reply-to: <20180323161612.GB4857@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180323161612.GB4857@chaz.gmail.com>
2018-03-23 16:16:13 +0000, Stephane Chazelas:
[...]
> - the first pipeline component must be a builtin or compound command
To clarify, as explained by Bart, it doesn't have to be builtin.
It's more easily reproducible with builtins as they exit quickly
but one just needs a command that exits before the command
substitution as in:
sleep 1 | ps -j $(sleep 2) | cat|cat|cat...
Another side effect is that
echo test | tee $(uname) | sleep 10 | cat
cannot be aborted with ^C as only "cat" is in foreground (echo
gone, tee (soon gone too) and sleep on their own process group).
Also, ^Z suspends cat only causing a deadlock.
That's probably a worse problem and could explain the similar
lock ups I sometimes experience in zsh.
> - the second component must have a command substitution in the
> arguments (OK when in targets of redirections).
[...]
Following-up on my previous email, that means:
$ n=1; echo $((++n)) | cat; echo $n
2
2
$ n=1; echo > $((++n)) | cat; echo $n
1
Which looks a bit inconsistent.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author