]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/savescreen.sh
ncurses 6.4 - patch 20240420
[ncurses.git] / test / savescreen.sh
index 56570e7e3cc4137b503a54bfc3f2975ee2d42ce6..1ffab2fcc170b66855399815110647c829ace141 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 2007-2009,2018 Free Software Foundation, Inc.                #
+# 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    #
 # copy of this software and associated documentation files (the "Software"), #
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: savescreen.sh,v 1.5 2018/01/06 00:04:14 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
 
@@ -57,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