set -e set -x testf () { test -f /nonexistent || return 1 return 0 } if testf; then exit 1 fi exit 0