3 tmpfiles="test-link-a.txt test-link-b.txt test-link-c.txt"
4 trap 'rm -fr $tmpfiles' 1 2 3 15
7 echo "hello" > test-link-a.txt || exit 1
9 # Use link() to create a new name for it.
10 ./test-link${EXEEXT} test-link-a.txt test-link-b.txt
14 echo "Skipping test: hard links are not supported on this file system"
20 cmp test-link-a.txt test-link-b.txt || exit 1
22 # Modify the contents of the first file.
23 echo "world" >> test-link-a.txt || exit 1
24 cmp test-link-a.txt test-link-b.txt || exit 1
26 # Modify the contents of the second file.
27 echo "some text" >> test-link-b.txt || exit 1
28 cmp test-link-a.txt test-link-b.txt || exit 1
30 # Delete the first file, then verity the second file still has the same
32 cp test-link-a.txt test-link-c.txt || exit 1
33 rm test-link-a.txt || exit 1
34 cmp test-link-b.txt test-link-c.txt || exit 1