Op 21-12-18 om 07:53 schreef Bart Schaefer: > On Thu, Dec 20, 2018 at 2:48 PM Martijn Dekker wrote: >>> tc-so:Executing command [ zsh --emulate sh -c wait 1 ] >>> tc-se:Fail: incorrect exit status: 1, expected: 127 > > Probably easily fixed. Well, kind of. I got as far as the attached patch, but it turns out there is another bug with 'wait': '(wait %1)' in a subshell quietly returns status 0 even if there is no such job. ('(wait %2)' and up are ok.) I can't figure out how to solve that bug, and perhaps that's for another patch anyway, so there is one regression test failure in the attached patch (in the second test, where 'wait' is run in a subshell with POSIX_BUILTINS set). I also suppressed the warnings for POSIX_BUILTINS. As Robert Elz already suspected, POSIX says: "If one or more pid operands are specified that represent unknown process IDs, wait shall treat them as if they were known process IDs that exited with exit status 127."[*] (note that 'pid operands' include job specs like %1). That means no warnings. (bash prints warnings in posix mode too, but, according to my testing, no other shell does.) Thanks, - M. [*] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wait.html