view move-if-change @ 46956:2c01ee3e5305

Move the node Relative Files before Directory Names. Show what file-name-nondirectory returns when given a directory name. Explain that abbreviate-file-name works on file names too. Explain how to combine a directory name with a relative file name with concat, and the pitfalls. Update some details.
author Richard M. Stallman <rms@gnu.org>
date Mon, 19 Aug 2002 18:43:18 +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