view move-if-change @ 2610:16738b49b833

[xemacs-hg @ 2005-02-23 22:09:13 by adrian] [PATCH] xemacs-21.5-clean: Avoid prohibitive string consing and GC <r7j8tbas.fsf@smtprelay.t-online.de>
author adrian
date Wed, 23 Feb 2005 22:09: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