- echo
- diff -c "$1" "$2"
- echo
- echo "$0: test failed, outputs are in $1 and $2."
- failed=`expr ${failed:-0} + 1`
+ cmp -s "$first" "$second" && success=1
+ fi
+
+ if [ "$success" ]; then
+ [ "$keepfirst" ] || rm -f "$first"
+ rm -f "$second"
+ else
+ echo
+ #### POSIX diff should support -c.
+ diff -c "$first" "$second" || true
+ echo
+ echo "$0: test failed, outputs are in $first and $second."
+ failed=`expr ${failed:-0} + 1`
+ #### Set return status of the function.
+ [ $failed -eq 0 ]