view move-if-change @ 2434:ba1cb56059fb

[xemacs-hg @ 2004-12-12 02:47:06 by ben] "Son of a bitch." files.el: File positions are 0 based not 1 based.
author ben
date Sun, 12 Dec 2004 02:47:09 +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