2 # Test both cp and mv for their behavior with -if and -fi
3 # The standards (POSIX and SuS) dictate annoyingly inconsistent behavior.
5 if test "$VERBOSE" = yes; then
11 . $srcdir/../envvar-check
13 # Make sure we get English translations.
14 . $srcdir/../lang-default
16 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
20 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
21 trap 'exit $?' 1 2 13 15
24 mkdir $tmp || framework_failure=1
25 cd $tmp || framework_failure=1
27 for i in a b c d e f g h; do
28 echo $i > $i || framework_failure=1
30 chmod 0 b d f h || framework_failure=1
31 echo y > y || framework_failure=1
33 if test $framework_failure = 1; then
34 echo 'failure in testing framework'
40 mv -fi c d < y >/dev/null 2>&1 || fail=1
42 # Before 4.0s, this would not prompt.
43 cp -if e f < y > out 2>&1 || fail=1
45 # Make sure out contains the prompt.
47 "cp: overwrite \`f', overriding mode 0000?"*) ;;
55 cp -fi g h < y > out 2>&1 || fail=1