view move-if-change @ 106777:e96c7312f94c

Fix compile-command's safe-local-variable condition. * progmodes/compile.el: Don't treat compile-command as safe if compilation-read-command might be nil (Bug#4218).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 09 Jan 2010 15:53:55 -0500
parents 354e0c45cedf
children 14a97ab281d5
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