exit 0
fi
+ PWDSAVE=`pwd`
+
# determine file's type
if [ -h "$FILE" ] ; then
#echo $FILE is a symlink
FILE=`basename "$FILE"`
# Go to $DEST and make the link
- PWDSAVE="$PWD"
cd "$DEST" # pushd
$RM "$FILE"
$SYMLINK "$TARGET" "$FILE"
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
- $RM "$DEST/$FILE"
- cp "$FILE" "$DEST"
+ # Only copy if the files differ
+ if ! cmp -s $FILE $DEST/`basename $FILE`; then
+ $RM "$DEST/`basename $FILE`"
+ cp "$FILE" "$DEST"
+ fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"