Ubuntu - convert a directory of .wav's to .mp3's

Here's a quickie shell script to convert .wav files to .mp3's:

cd to the directory, save this as convert.sh, then do chmod a+x convert.sh, then run it with ./convert.sh

#!/bin/sh

# convert all .wav's to .mp3's and remove the .wav from the resulting filename

for f in *.wav ; do lame -V2 $f ; done;
for f in *.mp3 ; do AUFILE=`echo "$f" | sed 's/.wav//g'` ; mv "$f" "$AUFILE"; done

If you want to remove all the .wav files just do rm -rf *.wav ...but be careful :)