#!/bin/sh for f in *.[Gg][Ii][Ff]; do giftoppm "$f" | ppmtopgm | pgmtopbm | pnmtopng >"${f%.[Gg][Ii][Ff]}.png" done .