view move-if-change @ 4400:555e21a66d51

2008-01-13 Michael Sperber <mike@xemacs.org> * files.el (insert-directory): Bind `coding-system-for-read' according to the current locale where available. (Previously, the default ended up being undecided, which doesn't work well for UTF-8-based locales, for example.)
author Mike Sperber <sperber@deinprogramm.de>
date Thu, 17 Jan 2008 10:18:05 +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