Skip to content

Instantly share code, notes, and snippets.

@aspyct
Created February 20, 2015 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspyct/3d8738fafa810ab14ab2 to your computer and use it in GitHub Desktop.
Save aspyct/3d8738fafa810ab14ab2 to your computer and use it in GitHub Desktop.
Publish images to Flickr
FLICKR="$HOME/Flickr"
for image in "$@"
do
basename=$(basename $image)
imagename=${basename%.*}
extension=${basename##*.}
counter=1
filename=$basename
while [ -f "$FLICKR/$filename" ]
do
filename="$imagename-$counter.$extension"
((counter++))
done
echo "$image -> $FLICKR/$filename"
ln "$image" "$FLICKR/$filename"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment