view move-if-change @ 56415:bda3d4cff473

(auto-revert-tail-mode, auto-revert-tail-mode-text, auto-revert-tail-pos): New vars. (auto-revert-mode): Turn off auto-revert-tail-mode, so we're not in both at the same time. (auto-revert-tail-mode): New command. (turn-on-auto-revert-tail-mode, auto-revert-tail-handler): New funs. (auto-revert-handler): Revert only either tail or whole file.
author Daniel Pfeiffer <occitan@esperanto.org>
date Wed, 14 Jul 2004 21:06:39 +0000
parents 354e0c45cedf
children 14a97ab281d5
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