Reading Time: < 1 minute On Ubuntu, install flac.
#apt-get install flac lame
Put the following script in /usr/bin/ and give it a name (convert_flac.sh or flac2mp3.sh)
#!/bin/bash
FLAC=$1
MP3="${FLAC%.flac}.mp3"
[ -r "$FLAC" ] || { echo can not read file \"$FLAC\" >&1 ; exit 1 ; } ;
metaflac --export-tags-to=- "$FLAC" | sed 's/=\(.*\)/="\1"/' >tmp.tmp
cat tmp.tmp
. ./tmp.tmp
rm tmp.tmp