#!/bin/sh for i in *.[mM][pP]3; do NAME=`echo $i | sed -e 's/ /_/g'|sed -e 's/...$/mp3/'` lame --decode "$i" `basename $NAME .mp3`.wav done