X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fsavescreen.sh;h=4a15ce427c760e5c62a1832e7528a1eba5f9325d;hp=e49aa1735061091f562c47ec65a32b895cdeb664;hb=deb0d07e8eb4803b9e9653359eab17a30d04369d;hpb=59108c98bda25ae50b3a319e2bcb7f4b9a174024 diff --git a/test/savescreen.sh b/test/savescreen.sh old mode 100755 new mode 100644 index e49aa173..4a15ce42 --- a/test/savescreen.sh +++ b/test/savescreen.sh @@ -1,6 +1,7 @@ #!/bin/sh ############################################################################## -# Copyright (c) 2007,2009 Free Software Foundation, Inc. # +# Copyright 2020 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"), # @@ -26,14 +27,23 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: savescreen.sh,v 1.4 2009/10/10 17:08:45 tom Exp $ +# $Id: savescreen.sh,v 1.6 2020/02/02 23: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} + +# "mktemp -d" would be preferable, but is not standard. +MY_DIR=$TMPDIR/savescreen$$ +trap "rm -rf $MY_DIR" EXIT INT QUIT HUP +umask 077 +mkdir $MY_DIR || exit 1 + PARAMS= NFILES=4 -PREFIX=savescreen-$$ +PREFIX=$MY_DIR/savescreen n=0 BEGINS=$PREFIX-$n.tmp while test $n != $NFILES @@ -43,12 +53,12 @@ do n=`expr $n + 1` done -./savescreen $PARAMS +${0%.sh} $PARAMS if test -f $BEGINS then while test -f $BEGINS do - ./savescreen -r $PARAMS + ${0%.sh} -r $PARAMS test $? != 0 && break done else