NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48729: Bug with /bin/sh and its 'wait'

>Number:         48729
>Category:       bin
>Synopsis:       Bug with /bin/sh and its 'wait'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 09 11:35:00 +0000 2014
>Originator:     Torbjörn Granlund
>Release:        6.1.3
NetBSD 6.1.3 NetBSD 6.1.3 (XEN3_DOM0) #0: Mon Feb 24 18:44:10 
CET 2014 amd64

The shell builtin command 'wait' is documented to return
the exit status of the waited-for command when 'wait' is
given a pid.

It does not, at least not under all circumstances.
#! /bin/sh

sleep 9999 &

(sleep 2; kill -9 $pid) &

wait $pid

echo "This should be 137:" $stat

My workaround is to use bash, or run the needed scripts under
another *BSD.

Home | Main Index | Thread Index | Old Index