Using lame to create mp3s from wavs

Using Audacity I converted one of the ripped WAVs into an MP3. However there was no possibility to batch convert WAV files. Thus I started to use lame from the command line. I created a shell script (encode.sh):
while [ $ -ge 1 ]; do
infn=$1
outfn="${infn%%.wav}.mp3"
echo $outfn
lame -v $infn $outfn
shift 1
done
It does the batch converting:
encode.sh *.wav The -v switch cause lame to encode using variable bitrate. -h would do fixed bitrate at 128, for other bitrates use e.g. -b 160. The -V 0 switch uses variable bitrate encoding with highest quality, while -V uses the lowest quality.