*** empty log message ***
[coreutils.git] / tests / cp / backup-1
blob20da790673ea85f160d29400aede5ab1c569b27e
1 #!/bin/sh
3 if test "$VERBOSE" = yes; then
4 set -x
5 cp --version
6 fi
8 suffix=.b
9 tmp=b1.$$
10 tmp_backup="$tmp$suffix"
11 temp_files="$tmp $tmp_backup"
12 rm -f $temp_files
14 fail=0
15 echo test > $tmp || fail=1
17 # Specify both version control and suffix so the environment variables
18 # (possibly set by the user running these tests) aren't used.
19 cp --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \
20 || fail=1
22 test -f $tmp || fail=1
23 test -f $tmp_backup || fail=1
24 cmp $tmp $tmp_backup > /dev/null || fail=1
26 rm -f $temp_files
28 exit $fail