*** empty log message ***
[coreutils.git] / tests / mv / hard-link-1
blob0d63765299cb090b702c36f25a67f35c3080d8ce
1 #!/bin/sh
2 # move a directory containing hard-linked files and
3 # make sure the links are preserved
5 : ${MV=mv}
6 : ${RM=rm}
7 : ${MKDIR=mkdir}
8 : ${LN=ln}
9 : ${LS=ls}
11 if test "$VERBOSE" = yes; then
12 set -x
13 $MV --version
16 . $srcdir/setup
18 if test -z "$other_partition_tmpdir"; then
19 exit 77
22 dir=hlink
24 framework_failure=0
25 $MKDIR $dir || framework_failure=1
26 > $dir/a || framework_failure=1
27 $LN $dir/a $dir/b || framework_failure=1
29 if test $framework_failure = 1; then
30 echo 'failure in testing framework'
31 exit 1
34 # Make sure we get English translations.
35 LANGUAGE=C
36 export LANGUAGE
37 LC_ALL=C
38 export LC_ALL
39 LANG=C
40 export LANG
42 $MV $dir $other_partition_tmpdir || fail=1
44 # Display inode numbers, one per line.
45 $LS -1i $other_partition_tmpdir/$dir > out || fail=1
47 # Make sure the inode numbers are the same.
48 a=`sed -n 's/ a$//p' out`
49 b=`sed -n 's/ b$//p' out`
50 test "$a" = "$b" || fail=1
52 $RM -fr out $dir $other_partition_tmpdir
54 exit $fail