.
[platform/upstream/coreutils.git] / tests / cp / no-deref-link1
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 mkdir a b
7 msg=bar
8 echo $msg > a/foo
9 cd b
10 ln -s ../a/foo .
11 cd ..
12
13 # It should fail with a message something like this:
14 #   ./cp: `a/foo' and `b/foo' are the same file
15 ./cp -d a/foo b 2>/dev/null
16
17 # Fail this test if the exit status is not 1
18 test $? = 1 || exit 1
19
20 test "`cat a/foo`" = bar || exit 1
21
22 exit 0