*** empty log message ***
[coreutils.git] / tests / rm / i-1
blob4020132c5bf5d57ca61dd5af7d786826c98ebf43
1 #!/bin/sh
3 : ${RM=rm}
4 test=i-1
6 if test "$VERBOSE" = yes; then
7 set -x
8 $RM --version
9 fi
11 # Don't require use of TMPDIR.
12 : ${RM_TMPDIR=.}
14 tmp=$RM_TMPDIR/t-rm.$$
16 test_failure=0
17 mkdir $tmp || test_failure=1
18 echo > $tmp/a || test_failure=1
19 test -f $tmp/a || test_failure=1
21 if test $test_failure = 1; then
22 echo 'failure in testing framework'
23 exit 1
26 echo y > $tmp/$test.Iy
27 echo n > $tmp/$test.In
29 fail=0
30 $RM -i $tmp/a < $tmp/$test.In > /dev/null 2>&1 || fail=1
31 # The file should not have been removed.
32 test -f $tmp/a || fail=1
34 $RM -i $tmp/a < $tmp/$test.Iy > /dev/null 2>&1 || fail=1
35 # The file should have been removed this time.
36 test -f $tmp/a && fail=1
38 rm -rf $tmp
40 exit $fail