8dfc6ba333418192321c715eb74401bc48216ac9
[platform/upstream/coreutils.git] / tests / cp / no-deref-link2
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 b
7 msg=bar
8 echo $msg > a
9 cd b
10 ln -s ../a .
11 cd ..
12
13 # It should fail with a message something like this:
14 #   ./cp: `a' and `b/foo' are the same file
15 ./cp -d a 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`" = bar || exit 1
21
22 exit 0