896d64d8a1eb65802db5bc802747be2c18a456c7
[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 # It should fail with a message something like this:
11 #   ./cp: `a' and `b' are the same file
12 ./cp -d a b 2>/dev/null
13
14 # Fail this test if the exit status is not 1
15 test $? = 1 || exit 1
16
17 test "`cat a`" = bar || exit 1
18
19 exit 0