Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: kill the LHS command of a pipe once the RHS command terminates
- X-seq: zsh-users 23995
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: kill the LHS command of a pipe once the RHS command terminates
- Date: Sat, 29 Jun 2019 16:30:55 +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=+BNOWq3Q+d0OZ/YyXU2bWgWNlTCi3QwIv3ZvOcfot2o=; b=svRLopjx9l5Cs348zPVCwUQGRLcxfjnnRGWdwL0Is+kUDNUQQRUWjBAZHkK4aEiK16 vHh1CEKVl9xvLlkkZxZ0VMHL8A34J0YgrPkI6IjlISFnxu/Og3gIKiJ2/shAAugojcor a0jW27qe1MPoYWLvEWNbNbH/0l3PwtNNHjTfJkTWYxkTZKnERZu5s05A8BWs6reXVRif /n7wArz+6eZV7zdx0/5dNUuuygANIcvAtLUOs4OA+suLZRMhtQW4giERQiYI/90mVF1i TRPydHKQmxpNs0/IC4O9IohWpmzazx/6mGgtJLuCx1t7NadbEDOJxXS9e/foZwviRZFe L/SQ==
- In-reply-to: <20190629012433.GA23526@zira.vinc17.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20190628110430.GA13790__36317.6205357135$1561719956$gmane$org@zira.vinc17.org> <20190628184134.btrejxp7jyoo6wz6@chaz.gmail.com> <20190629012433.GA23526@zira.vinc17.org>
2019-06-29 03:24:33 +0200, Vincent Lefevre:
[...]
> Thus if the left-hand-side process has terminated, this tries to
> kill a random process!
[...]
Fair enough.
Then, how about:
page-and-kill() ("$@" | { ${PAGER:-less}; kill -s PIPE 0; })
(only for use from an interactive shell where that page-and-kill
is run in its own process group).
That would also kill the extra processes that the command may
spawn.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author