I figured it out. I'm sure it's not the best way to do this, but through trial and error, this is what I figured out. If anyone has any cleaner ways to do this, I'd be happy to learn more.
Copy Single file to Dropbox and copy public URL:
(first shell script ever)
Code:
#!/bin/bash
cp $1/$2 /home/rycon/Dropbox/Public
text="http://dl.getdropbox.com/u/*******/$2"
echo -n "$text" | xsel -ib ## xclip -i -f -selection "clipboard"
I was figuring out which I'd rather use, xclip or xsel. I obviously decided on xsel.
Copy Multiple files to Dropbox and copy public URL:
(upgrading the first script)
Code:
#!/bin/bash
# Copy files to Dropbox and create file with Public URL for files
(while [ $# -gt 0 ]; do
cp $1 /home/rycon/Dropbox/Public
echo "http://dl.getdropbox.com/u/*****/$1" >> /home/rycon/temp/dropbox
shift
done
)
# Remove blank line at the top of output file.
mv /home/rycon/temp/dropbox /home/rycon/temp/dropbox.tmp
sed 1d /home/rycon/temp/dropbox.tmp > /home/rycon/temp/dropbox
rm /home/rycon/temp/dropbox.tmp
# Copy contents of file with URLs to the clipboard.
cat /home/rycon/temp/dropbox | xsel -ib ## xclip -i -f -selection "clipboard"
Bookmarks