update from savannah
[coreutils.git] / tests / mv / into-self-3
blob8641468efbd1f79550fe3591f05850ef251bb7de
1 #!/bin/sh
2 # move a directory into itself, with a twist
4 if test "$VERBOSE" = yes; then
5 set -x
6 mv --version
7 fi
9 dir1=is3-dir1
10 dir2=is3-dir2
12 framework_failure=0
13 rm -rf $dir1 $dir2 || framework_failure=1
14 mkdir $dir1 $dir2 || framework_failure=1
16 if test $framework_failure = 1; then
17 echo 'failure in testing framework'
18 exit 1
21 # Make sure we get English translations.
22 . $srcdir/../lang-default
24 # This mv command should exit nonzero.
25 mv $dir1 $dir2 $dir2 > out 2>&1 && fail=1
27 sed \
28 -e "s,mv:,XXX:,g" \
29 -e "s,$dir2,ZZZ,g" \
30 out > out2
32 cat > exp <<\EOF
33 XXX: cannot move `ZZZ' to a subdirectory of itself, `ZZZ/ZZZ'
34 EOF
36 cmp out2 exp || fail=1
38 rm -fr out out2 exp $dir1 $dir2
40 exit $fail