view move-if-change @ 5782:7277cf461612

Use an explicit hexadecimal constant for READ_BUF_SIZE, correct ChangeLog. src/ChangeLog addition: 2014-01-20 Aidan Kehoe <kehoea@parhasard.net> * fileio.c [...] (READ_BUF_SIZE): Use an explicit hexadecimal constant for the 0x20000 value for this, don't left-shift 2 16 times. Correct the last ChangeLog entry after Jerry James pointed out a mistake on my part. Thank you for review and discussion, Jerry and Stephen Turnbull.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 20 Jan 2014 18:13:15 +0000
parents 376386a54a3c
children
line wrap: on
line source

#!/bin/sh
if
test -r $2
then
if
cmp $1 $2 > /dev/null
then
echo $2 is unchanged
rm -f $1
else
mv -f $1 $2
fi
else
mv -f $1 $2
fi