view move-if-change @ 5568:b039c0f018b8

Error if byte-compiling a form hasn't wrapped byte-compile-inbuffer. lisp/ChangeLog addition: 2011-09-09 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el (byte-compile-from-buffer): If compiling a form has changed the current buffer (that is, some eval-when-compile form hasn't done save-excursion when appropriate), error and exit; we can't guarantee we'll give useful code in that context. See http://mid.gmane.org/20110909110831.GD2875@acm.acm and related discussion.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 09 Sep 2011 22:50:31 +0100
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