X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fsavescreen.sh;h=1ffab2fcc170b66855399815110647c829ace141;hb=382c1d0c3c8959d2e5ffb69e86469d00937aa4ae;hp=4a15ce427c760e5c62a1832e7528a1eba5f9325d;hpb=deb0d07e8eb4803b9e9653359eab17a30d04369d;p=ncurses.git diff --git a/test/savescreen.sh b/test/savescreen.sh old mode 100644 new mode 100755 index 4a15ce42..1ffab2fc --- a/test/savescreen.sh +++ b/test/savescreen.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2022 Thomas E. Dickey # # Copyright 2007-2009,2018 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -27,17 +27,18 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: savescreen.sh,v 1.6 2020/02/02 23:34:34 tom Exp $ +# $Id: savescreen.sh,v 1.8 2022/07/16 16:34:34 tom Exp $ # # Use this script to exercise "savescreen". # It starts by generating a series of temporary-filenames, which are passed # to the test-program. Loop as long as the first file named exists. -: ${TMPDIR:=/tmp} +: "${TMPDIR:=/tmp}" # "mktemp -d" would be preferable, but is not standard. MY_DIR=$TMPDIR/savescreen$$ -trap "rm -rf $MY_DIR" EXIT INT QUIT HUP +trap "rm -rf $MY_DIR; exit 1" 1 2 3 +trap "rm -rf $MY_DIR" 0 umask 077 mkdir $MY_DIR || exit 1 @@ -58,7 +59,7 @@ if test -f $BEGINS then while test -f $BEGINS do - ${0%.sh} -r $PARAMS + "${0%.sh}" -r $PARAMS test $? != 0 && break done else