OK, I'm sure there is a simple solution to this, but I can't figure it out. This is a simple script to sync bookmarks and a couple other files between 2 computers. "cp" doesn't like the syntax and there are other errors as well. I am a Unix idiot.
Code:
#!/bin/bash
TARGETVOL="Macintosh HD-1"
TARGETUSER="alexd"
PATH_TO_SOURCE_BOOKMARKS=~/Library/Application\ Support/Camino
PATH_TO_SOURCE_DOCS=~/Documents.sparseimage
PATH_TO_TARGET_HOME="/Volumes/${TARGETVOL}/Users/${TARGETUSER}"
PATH_TO_TARGET_BOOKMARKS="${PATH_TO_TARGET_HOME}/Library/Application\ Support/Camino"
PATH_TO_TARGET_DESKTOP="${PATH_TO_TARGET_HOME}/Desktop"
PATH_TO_TARGET_DOCS=$PATH_TO_TARGET_HOME
echo "Backing up old bookmarks on target..."
cp "${PATH_TO_TARGET_BOOKMARKS}/bookmarks.plist" \
"${PATH_TO_TARGET_BOOKMARKS}/bookmarks.old.plist"
echo "Copying bookmarks from source to target..."
cp ${PATH_TO_SOURCE_BOOKMARKS}/bookmarks.plist $PATH_TO_TARGET_BOOKMARKS
echo "Copying desktop contents from source to target..."
cp ~/Desktop/* $PATH_TO_TARGET_DESKTOP
echo -n "Copy documents from source to target? (y/n) "
read -e $DOCSPROMPT
if [ $DOCSPROMPT = "y" ]; then
echo -n " Copying documents..."
cp $PATH_TO_SOURCE_DOCS $PATH_TO_TARGET_DOCS
echo "done"
fi
echo "Done"