view move-if-change @ 3462:6c7605dfcf07

[xemacs-hg @ 2006-06-19 18:19:33 by james] Fix various problems found by static checkers: use of uninitialized values, dereferencing pointers before checking whether they are NULL, memory leaks, and incomplete checking of return values. <m3k67gpyhk.fsf@jerrypc.cs.usu.edu>
author james
date Mon, 19 Jun 2006 18:19:38 +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