1 2failures= 3failure() { 4 echo "Error at line $1" >&2 5 failures=x$failures 6} 7 8for i in 1 2 3 4 5 6 7 8 9 10; do 9 exit $i & 10done 11wait || failure $LINENO 12wait || failure $LINENO 13 14test -z "$failures" 15