Converting mp3 to wav

Lynn David Newton plug-discuss@lists.plug.phoenix.az.us
Mon, 28 Jan 2002 20:11:56 -0700


>> for i in *.mp3
>> do
>> j=`basename $i .mp3`
>> mp32wav $i $j.wav
>> done

> for i in *.mp3
> do
>       mp32wav $i ${i%mp3}wav
>       # use a hash, #, to change something at the front
> done

Yes, better still. I wasn't sure that functionality was available in bash.

Also, the hipper way to write command evaluation is not with backticks, but
with $(...), i.e., $(basename $i .mp3) rather than `basename $i .mp3`, but
didn't know if that worked in bash either. But Hans' superior (and faster)
version obviates the need for running a command entirely.

I just remembered what it was that I discovered bash does not have that ksh
does, namely "print". All my ksh shell scripts use print rather than echo,
including its sophisticated options to write to file descriptors:

exec 3>somelogfile
exec 4<someinput

while read -u4 first second third
do
  if [[ $first != $whateverexpected ]]
  then
    print -u3 "some log message"
  fi
done

etc. Don't know if there is a bash equivalent for that. Probably, but I
never stopped to learn.

-- 
Lynn David Newton
Phoenix, Arizona