Skip to content

Instantly share code, notes, and snippets.

@andytlr
Last active August 29, 2015 14:01
Show Gist options
  • Save andytlr/c192f7169e7323efddfb to your computer and use it in GitHub Desktop.
Save andytlr/c192f7169e7323efddfb to your computer and use it in GitHub Desktop.
n=0
while read line ; do
let n=n+1
filename=`basename "$line"`
dropboxuser=21267 # Replace with your ID
directory=/shots/keep/ # This is the full path iside your Public Dropbox directory. The slashes are important.
path=~/Dropbox/Public$directory
mkdir -p $path
date=$(date +%H-%M-%S)-
if [ -f $path$filename ] ;then
mv $line $path$date$filename
printf https://dl.dropboxusercontent.com/u/$dropboxuser$directory$date$filename | pbcopy
else
mv $line $path$filename
printf https://dl.dropboxusercontent.com/u/$dropboxuser$directory$filename | pbcopy
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment