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