.
[coreutils.git] / tests / rm / sunos-1
blob0cb73111408c35d65bf7201dc1e09ce4577f6330
1 #!/bin/sh
2 # Make sure that rm -r '' fails.
3 # On SunOS 4.1.3, running rm -r '' in a nonempty directory may
4 # actually remove files with names of entries in the current directory
5 # but relative to `/' rather than relative to the current directory.
7 : ${RM=rm}
8 test=sunos-1
10 if test "$VERBOSE" = yes; then
11 set -x
12 $RM --version
15 tmp=t-rm.$$
17 # We're going to run RM from a subdir.
18 # Prepend ../ if $RM is a relative file name.
19 case $RM in
20 /*) ;;
21 */*) RM=../$RM
22 esac
24 test_failure=0
25 mkdir $tmp || test_failure=1
27 if test $test_failure = 1; then
28 echo 'failure in testing framework'
29 exit 1
32 fail=0
33 cd $tmp
34 $RM -r '' > /dev/null 2>&1 && fail=1
35 cd ..
36 rm -rf $tmp
38 exit $fail