diff options
author | Jim Meyering <jim@meyering.net> | 2002-04-19 19:54:15 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-04-19 19:54:15 +0000 |
commit | e86cf7f5e6ca2ebdec14a7ef5f7c7f1ad680096f (patch) | |
tree | 48d8cf89a1d0a2eeaf5fc161878481a9cec88eb5 /tests/rm | |
parent | ad9fd82850e90fa2387956dc51bb3617015f5bb3 (diff) | |
download | coreutils-e86cf7f5e6ca2ebdec14a7ef5f7c7f1ad680096f.tar.xz |
Use `rm', not $RM. Use better trap.
Diffstat (limited to 'tests/rm')
-rwxr-xr-x | tests/rm/i-1 | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/rm/i-1 b/tests/rm/i-1 index 4020132c5..099c1bd95 100755 --- a/tests/rm/i-1 +++ b/tests/rm/i-1 @@ -1,17 +1,16 @@ #!/bin/sh -: ${RM=rm} test=i-1 if test "$VERBOSE" = yes; then set -x - $RM --version + rm --version fi -# Don't require use of TMPDIR. -: ${RM_TMPDIR=.} - -tmp=$RM_TMPDIR/t-rm.$$ +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 test_failure=0 mkdir $tmp || test_failure=1 @@ -27,11 +26,11 @@ echo y > $tmp/$test.Iy echo n > $tmp/$test.In fail=0 -$RM -i $tmp/a < $tmp/$test.In > /dev/null 2>&1 || fail=1 +rm -i $tmp/a < $tmp/$test.In > /dev/null 2>&1 || fail=1 # The file should not have been removed. test -f $tmp/a || fail=1 -$RM -i $tmp/a < $tmp/$test.Iy > /dev/null 2>&1 || fail=1 +rm -i $tmp/a < $tmp/$test.Iy > /dev/null 2>&1 || fail=1 # The file should have been removed this time. test -f $tmp/a && fail=1 |