view move-if-change @ 4137:1ce0622a56a3

[xemacs-hg @ 2007-08-22 15:10:10 by aidan] Patch from Nix; fix buffer overrun in pdump_load() See 87y7r4lzwf.fsf@hades.wkstn.nix , also http://calypso.tux.org/pipermail/xemacs-patches/2006-October/000017.html for explanation
author aidan
date Wed, 22 Aug 2007 15:10:19 +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