Below are three scripts that convert .ogg files to .mp3 files. You need to place the scripts in the directory where the files are and execute them from that directory.
First we have to convert the ogg to .wave files.

#!/bin/bash

# Dump cd to .wav files
for i in *.m4a
do
mplayer -ao pcm "$i" -aofile "$i.wav"
done

Second we need to convert the .wav files to .mp3.

#!/bin/bash

# Convert .wav file to .mp3 using lame
for i in *.wav
do
lame -h -b 192 "$i" "$i.mp3"
done

Third we need to rename the files.

#!/bin/bash

# Rename and remove all file that do not end in .mp3
for i in *.mp3
do
x=`echo "$i"|sed -e \'s/m4a.wav.mp3/mp3/\'`
mv "$i" "$x"
done