coreutils/tests/rm/r-1
1997-08-16 17:40:57 +00:00

42 lines
531 B
Bash
Executable File

#!/bin/sh
: ${RM=rm}
test=r-1
# TMPDIR should be an absolute dir for this test.
# FIXME: enforce it
: ${TMPDIR=/tmp}
if test "$VERBOSE" = yes; then
set -x
$RM --version
fi
tmp=$TMPDIR/t-rm.$$
mkdir $tmp
mkdir $tmp/a $tmp/a/a
touch $tmp/b
fail=0
$RM --verbose -r $tmp/a $tmp/b > $tmp/$test.O || fail=1
for d in $dirs; do
if test -d $d; then
fail=1
fi
done
cat <<EOF > $tmp/$test.E
$tmp/a
$tmp/a/a
$tmp/b
EOF
# Compare expected and actual output.
cmp $tmp/$test.E $tmp/$test.O || fail=1
rm -rf $tmp
exit $fail