30bdf1d93da1fb09ee1c3579b73ffac95afb6f78
[platform/upstream/coreutils.git] / tests / ln / backup-1
1 #!/bin/sh
2 # Try to create a symlink with backup where the destination file exists
3 # and the backup file name is a hard link to the destination file.
4 # Based on a problem report from Jamie Lokier.
5
6 if test "$VERBOSE" = yes; then
7   set -x
8   ln --version
9 fi
10
11 trap "rm -rf a b b~" 0 1 2 3 15
12
13 framework_failure=0
14 touch a b || framework_failure=1
15
16 if test $framework_failure = 1; then
17   echo 'failure in testing framework'
18   exit 1
19 fi
20
21 ln b b~ || fail=1
22 ln -f --b=simple a b || fail=1
23
24 exit $fail