summaryrefslogtreecommitdiff
path: root/tests/rm/sunos-1
blob: 0cb73111408c35d65bf7201dc1e09ce4577f6330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# Make sure that rm -r '' fails.
# On SunOS 4.1.3, running rm -r '' in a nonempty directory may
# actually remove files with names of entries in the current directory
# but relative to `/' rather than relative to the current directory.

: ${RM=rm}
test=sunos-1

if test "$VERBOSE" = yes; then
  set -x
  $RM --version
fi

tmp=t-rm.$$

# We're going to run RM from a subdir.
# Prepend ../ if $RM is a relative file name.
case $RM in
  /*) ;;
  */*) RM=../$RM
esac

test_failure=0
mkdir $tmp || test_failure=1

if test $test_failure = 1; then
  echo 'failure in testing framework'
  exit 1
fi

fail=0
cd $tmp
$RM -r '' > /dev/null 2>&1 && fail=1
cd ..
rm -rf $tmp

exit $fail