view move-if-change @ 99106:814d2d823dd7

New function `locate-user-emacs-file'. * subr.el (locate-user-emacs-file): New function. (user-emacs-directory): Mention it in docstring. * completion.el (save-completions-file-name): * filesets.el (filesets-menu-cache-file): * image-dired.el (image-dired-dir, image-dired-db-file) (image-dired-temp-image-file, image-dired-gallery-dir) (image-dired-temp-rotate-image-file): * savehist.el (savehist-file): * server.el (server-auth-dir): * startup.el (auto-save-list-file-prefix): * thumbs.el (thumbs-thumbsdir): * tutorial.el (tutorial--saved-dir): * play/gamegrid.el (gamegrid-user-score-file-directory): Use it. * url.el (url-configuration-directory): Use `locate-user-emacs-file'. * NEWS: New function `locate-user-emacs-file'.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 24 Oct 2008 09:39:27 +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