*** empty log message ***
[coreutils.git] / tests / mv / force
blob2293b2d65e9e283e5cb22c80f376bde75916e3a2
1 #!/bin/sh
2 # move a file onto itself
4 if test "$VERBOSE" = yes; then
5 set -x
6 mv --version
7 fi
9 ff=mvforce
10 ff2=mvforce2
12 framework_failure=0
13 rm -f $ff $ff2 || framework_failure=1
14 echo force-contents > $ff || framework_failure=1
15 ln $ff $ff2 || framework_failure=1
17 if test $framework_failure = 1; then
18 echo 'failure in testing framework'
19 exit 1
22 # Make sure we get English translations.
23 . $srcdir/../lang-default
25 # This mv command should exit nonzero.
26 mv $ff $ff > out 2>&1 && fail=1
28 cat > exp <<EOF
29 mv: \`$ff' and \`$ff' are the same file
30 EOF
32 cmp out exp || fail=1
33 test `cat $ff` = force-contents || fail=1
35 # This should succeed, even though the source and destination
36 # device and inodes are the same.
37 mv $ff $ff2 || fail=1
39 rm -fr out exp $ff $ff2
41 exit $fail