From: Alexey Gladkov <gladkov.alexey@gmail.com>
To: dash list <dash@vger.kernel.org>
Subject: 'wait' program does not wait
Date: Thu, 08 Oct 2009 18:18:13 +0400 [thread overview]
Message-ID: <4ACDF4A5.3040501@gmail.com> (raw)
Greetings!
'wait' does not wait for all jobs and return a non-zero exit status.
According dash(1):
wait [job]
Wait for the specified job to complete and return the exit status
of the last process in the job. If the argument is omitted, wait
for all jobs to complete and the return an exit status of zero.
$ cat test.sh
#!/bin/dash
func() {
sleep $1
echo "func($1)"
}
func 1 &
func 2 &
func 3 &
wait
$ dash ./test.sh; echo "after rc=$?"
func(1)
after rc=145
func(2)
func(3)
$ bash ./test.sh; echo "after rc=$?"
func(1)
func(2)
func(3)
after rc=0
--
Rgrds, legion
reply other threads:[~2009-10-08 14:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4ACDF4A5.3040501@gmail.com \
--to=gladkov.alexey@gmail.com \
--cc=dash@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox