]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - tests/exec12.sub
bash-5.0 distribution sources and documentation
[thirdparty/bash.git] / tests / exec12.sub
index 4bd6121b3f8b858d5e616378d3d43030e379c56b..79bcfc77ce9d84cecf826c9671c19985c1ed826c 100644 (file)
@@ -1,9 +1,11 @@
 : ${TMPDIR:=/var/tmp}
 TMPFILE=$TMPDIR/exitcode
+trap 'rm -f $TMPFILE' 0
 
 rm -f $TMPFILE
 set -e
-exit_handler() { echo "exit code: $?" ; touch $TMPFILE; }
+# we normalize the exit code to accommodate false returning 255 on Solaris
+exit_handler() { echo "exit code: $(( $? != 0 ))" ; touch $TMPFILE; }
 false() { ! :; }
 notfound() { nosuchcommand ; }
 syntaxerror() { !:; }