On Thu, May 31, 2018, 14:40 Stephen via talk, <talk@gtalug.org> wrote:

#!/bin/bash
cd /big1/memes/;

shopt -s nullglob
for f in "*.png"
do
     echo $f

This is where you get the PNG echoes. 

     b=${f%.png}
     echo $b
done


You can also do

  convert file.{png,jpg}

and bash will do the magic. What I don't know is if that will accept a glob. 

Using convert is okay, but you won't end up with the smallest JPEGs that way.

Stewart