exit test.sh on fail with correct code