1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 02:10:57 +02:00
Files
coreutils/tests/cp/backup-1
Jim Meyering 8dfdbd327c .
1997-07-09 18:11:59 +00:00

31 lines
560 B
Bash
Executable File

#!/bin/sh
: ${CP=cp}
if test "$VERBOSE" = yes; then
set -x
$CP --version
fi
suffix=.b
tmp=b1.$$
tmp_backup="$tmp$suffix"
temp_files="$tmp $tmp_backup"
rm -f $temp_files
fail=0
echo test > $tmp || fail=1
# Specify both version control and suffix so the environment variables
# (possibly set by the user running these tests) aren't used.
$CP --force --backup --version-control=simple --suffix=$suffix $tmp $tmp \
|| fail=1
test -f $tmp || fail=1
test -f $tmp_backup || fail=1
cmp $tmp $tmp_backup > /dev/null || fail=1
rm -f $temp_files
exit $fail