From: Greg Klanderman <gak@klanderman.net>
To: zsh-users@zsh.org
Subject: unable to wait on completed job [was: should $! give the pid of subshell?]
Date: Sun, 29 Nov 2009 23:04:54 -0500 [thread overview]
Message-ID: <m3638sr72x.fsf_-_@klanderman.net> (raw)
In-Reply-To: <200911251748.nAPHmrCX010198@news01.csr.com> (Peter Stephenson's message of "Wed, 25 Nov 2009 17:48:52 +0000")
>>>>> On November 25, 2009 Peter Stephenson <pws@csr.com> wrote:
> zsh "exec"s the final
> command since it notices the subshell isn't needed any more so there's
> no point in forking.
Oh cool, I didn't realize zsh did tail recursion..
OK, so let me change the question a bit. If I run this script:
#!/bin/zsh -f
sleep 10 &
pid=$!
sleep 12
wait $pid
I get the error:
| zshbgtest.zsh:wait:12: pid 19673 is not a child of this shell
Using bash or ksh, I can successfully wait on the completed job.
Shouldn't I be able to wait on a job that has completed in zsh?
This is zsh 4.3.10-dev-1, patchlevel 1.4816 if it matters, though
4.2.0 and 4.2.6 behave the same.
thanks,
Greg
next prev parent reply other threads:[~2009-11-30 4:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 17:17 should $! give the pid of subshell? Greg Klanderman
2009-11-25 17:48 ` Peter Stephenson
2009-11-30 4:04 ` Greg Klanderman [this message]
2009-11-30 5:14 ` unable to wait on completed job [was: should $! give the pid of subshell?] Bart Schaefer
2009-11-30 15:36 ` unable to wait on completed job Greg Klanderman
2009-11-30 17:48 ` Bart Schaefer
2009-11-30 21:50 ` Greg Klanderman
2009-12-01 22:33 ` Greg Klanderman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3638sr72x.fsf_-_@klanderman.net \
--to=gak@klanderman.net \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).