#!/bin/sh

for f in *.bmp; do
  nf=`echo $f|sed s/bmp/pgm/`
  bmptoppm < $f | ppmtopgm > $nf;
  rm $f
done

