1 2 3 4 5 6 7 8
#!/bin/sh sleep 3 & sleep 1 & wait %1 [ $? = 0 ] || echo fail1 wait %2 [ $? = 0 ] || echo fail2