summaryrefslogtreecommitdiff
path: root/tests/rm/dangling-symlink
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-07-04 12:04:37 +0000
committerJim Meyering <jim@meyering.net>2002-07-04 12:04:37 +0000
commitdd2496d71e4b48b4ccbb7f1ab5e77b178a03b8a5 (patch)
treead4de2479a23d71ec1e183efea170b601650d2da /tests/rm/dangling-symlink
parent8a7ec6fa52d78078b59839da063660ae84aa1717 (diff)
downloadcoreutils-dd2496d71e4b48b4ccbb7f1ab5e77b178a03b8a5.tar.xz
*** empty log message ***
Diffstat (limited to 'tests/rm/dangling-symlink')
-rwxr-xr-xtests/rm/dangling-symlink28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/rm/dangling-symlink b/tests/rm/dangling-symlink
new file mode 100755
index 000000000..b76599562
--- /dev/null
+++ b/tests/rm/dangling-symlink
@@ -0,0 +1,28 @@
+#!/bin/sh
+# rm should not prompt before removing a dangling symlink
+
+if test "$VERBOSE" = yes; then
+ set -x
+ rm --version
+fi
+
+pwd=`pwd`
+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
+trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap '(exit $?); exit' 1 2 13 15
+
+framework_failure=0
+mkdir -p $tmp || framework_failure=1
+cd $tmp || framework_failure=1
+ln -s no-file dangle
+
+if test $framework_failure = 1; then
+ echo '$0: failure in testing framework' 1>&2
+ (exit 1); exit
+fi
+
+fail=0
+
+rm dangle < /dev/null > /dev/null 2>&1 || fail=1
+
+(exit $fail); exit