Skip to content

Instantly share code, notes, and snippets.

@Mad182
Created June 27, 2013 09:55
Show Gist options
  • Save Mad182/5875317 to your computer and use it in GitHub Desktop.
Save Mad182/5875317 to your computer and use it in GitHub Desktop.
Recursive image optimization
#!/bin/bash
optimize() {
jpegoptim *.jpg --strip-all
optipng *.png
for i in *
do
if test -d $i
then
cd $i
echo $i
optimize
cd ..
fi
done
echo
}
optimize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment