Remove suppression-related options.
[coreutils.git] / tests / rm / dangling-symlink
blob1b1968a8593409dc027731c3cdf80e7a9c12f83d
1 #!/bin/sh
2 # rm should not prompt before removing a dangling symlink.
3 # Likewise for a non-dangling symlink.
4 # But for fileutils-4.1.9, it would do the former and
5 # for fileutils-4.1.10 the latter.
7 if test "$VERBOSE" = yes; then
8 set -x
9 rm --version
12 pwd=`pwd`
13 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
14 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
15 trap '(exit $?); exit' 1 2 13 15
17 framework_failure=0
18 mkdir -p $tmp || framework_failure=1
19 cd $tmp || framework_failure=1
20 ln -s no-file dangle
21 ln -s / symlink
23 if test $framework_failure = 1; then
24 echo "$0: failure in testing framework" 1>&2
25 (exit 1); exit 1
28 fail=0
30 rm --presume-input-tty dangle symlink &
31 pid=$!
32 # The buggy rm (fileutils-4.1.9) would hang here, waiting for input.
34 # Give the working rm a chance to remove the file.
35 sleep 1
37 # The file must no longer exist.
38 ls -l dangle > /dev/null 2>&1 && fail=1
39 ls -l symlink > /dev/null 2>&1 && fail=1
41 kill $pid > /dev/null 2>&1
43 (exit $fail); exit $fail