Hello, Bash was supposed to return 128+signal if a signal is received while running wait command. However, the "builtin wait" does not do the same. "builtin wait" simply ignores that the signal happened.
This happens at least since version 3.2.57(2)-release (x86_64-suse-linux-gnu) until 4.4.12(1)-release #!/bin/bash trap "true" USR1 ( sleep 1 echo "Signal while wait" kill -USR1 $$ sleep 1 echo "Signal while builtin wait" kill -USR1 $$ sleep 1 echo "Normal exiting" exit 3 ) & _pid=$! wait echo $? builtin wait $_pid echo $? $ bash wait_test.bash Signal while wait 138 Signal while builtin wait Normal exiting 3 Both waits should return 138? I detected this while trying to replace wait with a function in order to ignore when it returned because of a signal (with a very ugly hack). So, the "builtin wait" behavior was exactly the one I was trying to implement. I guess command wait could have an optional argument for both behavior (exit or ignore on signal). Is this expected and simply not documented (doc bug), or both wait should be equal? I just don't want to rely on a bug behavior that might break in the future. Regards, -- Luiz Angelo Daros de Luca luizl...@gmail.com