summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-04-19 19:54:15 +0000
committerJim Meyering <jim@meyering.net>2002-04-19 19:54:15 +0000
commite86cf7f5e6ca2ebdec14a7ef5f7c7f1ad680096f (patch)
tree48d8cf89a1d0a2eeaf5fc161878481a9cec88eb5 /tests
parentad9fd82850e90fa2387956dc51bb3617015f5bb3 (diff)
downloadcoreutils-e86cf7f5e6ca2ebdec14a7ef5f7c7f1ad680096f.tar.xz
Use `rm', not $RM. Use better trap.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/rm/i-115
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