Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Implicit killing of subprocesses
- X-seq: zsh-users 17945
- From: René Neumann <lists@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Implicit killing of subprocesses
- Date: Wed, 28 Aug 2013 14:54:32 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi,
I have a question regarding if and when subprocesses are killed when
exiting a shell script.
My case: I want to pipe the output of a longrunning process (here:
dbus-monitor) through some evaluation. As it does not read from stdin, I
can't simply close it by sending EOF.
When I use
coproc dbus-monitor
while read -p line; do ... done
the dbus-monitor process lurks around after the script finishes
(breaking or returning from the loop).
When I use
dbus-monitor | while read -p line; do ... done
it does not (i.e. it gets killed).
My questions now are:
- Can I build on the process being killed when exiting the loop (in the
second case)? Or does it only work in some cases?
- Is it intentional that coprocs don't get killed and I have to make it
by hand? (Which is hard if you have "coproc dbus-monitor | grep ...", as
$! only holds the grep).
Thanks and regards,
René
Messages sorted by:
Reverse Date,
Date,
Thread,
Author