1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-01 22:36:26 +02:00
Files
coreutils/tests/cp/backup-1
T

29 lines
528 B
Bash
Raw Normal View History

1997-07-08 23:00:29 +00:00
#!/bin/sh
1997-07-09 18:11:59 +00:00
if test "$VERBOSE" = yes; then
set -x
cp --version
1997-07-09 18:11:59 +00:00
fi
1997-07-08 23:00:29 +00:00
suffix=.b
tmp=b1.$$
tmp_backup="$tmp$suffix"
1997-07-08 23:04:58 +00:00
temp_files="$tmp $tmp_backup"
rm -f $temp_files
1997-07-08 23:00:29 +00:00
1997-07-08 23:04:58 +00:00
fail=0
echo test > $tmp || fail=1
1997-07-08 23:00:29 +00:00
1997-07-08 23:06:36 +00:00
# Specify both version control and suffix so the environment variables
# (possibly set by the user running these tests) aren't used.
cp --force --backup=simple --suffix=$suffix $tmp $tmp \
1997-07-08 23:04:58 +00:00
|| fail=1
1997-07-08 23:00:29 +00:00
1997-07-08 23:04:58 +00:00
test -f $tmp || fail=1
test -f $tmp_backup || fail=1
1997-07-08 23:05:32 +00:00
cmp $tmp $tmp_backup > /dev/null || fail=1
1997-07-08 23:00:29 +00:00
1997-07-08 23:04:58 +00:00
rm -f $temp_files
exit $fail