Skip to content

Instantly share code, notes, and snippets.

@saw303
Created January 27, 2014 14:33
Show Gist options
  • Save saw303/8649554 to your computer and use it in GitHub Desktop.
Save saw303/8649554 to your computer and use it in GitHub Desktop.
Iterate on files using bash (template to convert PNGs and JPEGs to WebPs)
#!/bin/bash
for f in /tmp/*.{JPG,jpg,PNG,png};
do
FILE="$f.webp"
if [ ! -f $FILE ]
then
echo "Converting image $f to $(basename $f).webp";
else
echo "WebP image $(basename $f).webp does exist";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment