.
[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 fail=0
14
15 # It should fail with a message something like this:
16 #   ./cp: `a/foo' and `b/foo' are the same file
17 ./cp -d a/foo b 2>/dev/null
18
19 # Fail this test if the exit status is not 1
20 test $? = 1 || fail=1
21
22 test "`cat a/foo`" = $msg || fail=1
23
24 rm -rf a b
25
26 exit $fail