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 || exit 1
11 cmp test-link-a.txt test-link-b.txt || exit 1
13 # Modify the contents of the first file.
14 echo "world" >> test-link-a.txt || exit 1
15 cmp test-link-a.txt test-link-b.txt || exit 1
17 # Modify the contents of the second file.
18 echo "some text" >> test-link-b.txt || exit 1
19 cmp test-link-a.txt test-link-b.txt || exit 1
21 # Delete the first file, then verity the second file still has the same
23 cp test-link-a.txt test-link-c.txt || exit 1
24 rm test-link-a.txt || exit 1
25 cmp test-link-b.txt test-link-c.txt || exit 1