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