view move-if-change @ 3282:390dee4913ba

[xemacs-hg @ 2006-03-14 19:31:41 by james] Add a missing do to a do { ... } while(0) macro. See message ID <1141930812.4329.8.camel@jerrypc.cs.usu.edu> on the xemacs-patches list.
author james
date Tue, 14 Mar 2006 19:31:43 +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