* 'wait' program does not wait
@ 2009-10-08 14:18 Alexey Gladkov
0 siblings, 0 replies; only message in thread
From: Alexey Gladkov @ 2009-10-08 14:18 UTC (permalink / raw)
To: dash list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-08 14:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-08 14:18 'wait' program does not wait Alexey Gladkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox