NetBSD-Users archive

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

/bin/sh incorrect return status for background jobs

Hello, I don't seem to be able to get correct return status for
background jobs with NetBSD /bin/sh

From the man page:

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 then return an exit status of zero.

However if I run the following script


        sleep 2
        touch /no_such_file

func &
wait $!
echo $?

I always get 0 as return status with NetBSD sh:
$ ./
touch: /no_such_file: Permission denied

Same script executed with bash:
atom510$ ./
touch: /no_such_file: Permission denied

Looks like a bug to me?

Home | Main Index | Thread Index | Old Index