Converting mp3 to wav

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Lynn David Newton
Date:  
Subject: Converting mp3 to wav
>> 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