*** empty log message ***
[coreutils.git] / tests / cp / backup-is-src
blob13ec99290ca179c38da1bc03cc9e6bab724a6921
1 #!/bin/sh
3 if test "$VERBOSE" = yes; then
4 set -x
5 cp --version
6 fi
8 framework_failure=0
9 rm -f a a~ || framework_failure=1
10 echo a > a || framework_failure=1
11 echo a-tilde > a~ || framework_failure=1
13 if test $framework_failure = 1; then
14 echo 'failure in testing framework'
15 exit 1
18 # Make sure we get English translations.
19 LANGUAGE=C
20 export LANGUAGE
21 LC_ALL=C
22 export LC_ALL
23 LANG=C
24 export LANG
26 # This cp command should exit nonzero.
27 cp -b -V simple a~ a > out 2>&1 && fail=1
29 sed "s,cp:,XXX:," out > out2
31 cat > exp <<\EOF
32 XXX: backing up `a' would destroy source; `a~' not copied
33 EOF
35 cmp out2 exp || fail=1
37 rm -f out out2 exp a a~
39 exit $fail