Shell script terminates when spawning and killing a background shell process

Gerhard Rieger <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
Hello,

I maintain a long bash script that runs fine on most platforms. However, 
on NetBSD it terminates before reaching the end.

I have reduced the case to the following ksh script that terminates when 
it kills its background process, this happens on NetBSD 9.3 and NetBSD 
10.1; when you don't think this script should print "SURVIVED"
this issue might be a feature though...


#! /bin/ksh

/bin/ksh -c "sleep 2" </dev/null &
pid0=$!

sleep 1

kill $pid0
wait

echo SURVIVED
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.