view move-if-change @ 2687:45609533aa75

[xemacs-hg @ 2005-03-25 16:34:53 by aidan] Andrey Slusar's FreeBSD fixes for fakemail.c, unexelf.c, as sent in 86d5uq2e3i.fsf@santinel.home.ua .
author aidan
date Fri, 25 Mar 2005 16:35:00 +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