Ian Jackson: set +e diff -aruN -- "$directory.orig" "$directory" >"$tmpfile" set -e test $? = 0 -o $? = 1 || exit 1 Unless you want to check the return code from set, shouldn't this be: set +e diff -aruN -- "$directory.orig" "$directory" >"$tmpfile" test $? = 0 -o $? = 1 || exit 1 set -e ? -- Raul