1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 18:26:32 +02:00

use better trap

This commit is contained in:
Jim Meyering
2002-04-19 21:17:08 +00:00
parent dc3a2321e0
commit 5aaccdf6a7

View File

@@ -1,21 +1,18 @@
#!/bin/sh
# Just like p-1, but with TMPDIR=.
TMPDIR=.
# Just like p-1, but with an absolute path.
if test "$VERBOSE" = yes; then
set -x
mkdir --version
fi
tmp=$TMPDIR/t-mkdir.$$
temp_files=$tmp
rm -rf $temp_files
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
mkdir --parents $tmp || fail=1
test -d $tmp || fail=1
rm -rf $temp_files
exit $fail