view move-if-change @ 61773:923d3b20f747

(read-directory-name): Always pass non-nil DEFAULT-FILENAME arg to read-file-name. (backup-buffer-copy, basic-save-buffer-2): Take care against writing thru an unexpected existing symlink. (revert-buffer): In indirect buffer, revert the base buffer. (magic-mode-alist): Doc fix. (buffer-stale-function): Doc fix. (minibuffer-with-setup-hook): Avoid warning. (mode-require-final-newline): Doc and custom fix.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 Apr 2005 16:53:21 +0000
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