Created
January 27, 2014 14:33
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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