.
[coreutils.git] / tests / cp / no-deref-link3
blob41910e1a343635a4625362e11c498760ac98597f
1 #!/bin/sh
2 # FIXME: This test requires ln -s.
3 # cp from 3.16 fails this test
5 if test "$VERBOSE" = yes; then
6 set -x
7 cp --version
8 fi
10 rm -rf a b
11 msg=bar
12 echo $msg > a
13 ln -s a b
15 fail=0
17 # It should fail with a message something like this:
18 # cp: `a' and `b' are the same file
19 cp -d a b 2>/dev/null
21 # Fail this test if the exit status is not 1
22 test $? = 1 || fail=1
24 test "`cat a`" = $msg || fail=1
26 rm -f a b
28 exit $fail