view move-if-change @ 4640:8cef85a39d2c

Make CDPATH handling portable, accept entries not matching "/$". 2009-06-06 Aidan Kehoe <kehoea@parhasard.net> * files.el (cd): Make CDPATH handling portable, accept entries without trailing slashes within it. Some style corrections from Stephen Turnbull, thank you Stephen.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 06 Jun 2009 17:20:21 +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