[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: sox help needed



On Thu, May 20, 2004 at 04:58:52PM +0100, Colin Watson wrote:
> > mpg123 -s $i | sox -t raw -r 44100 -s -w -c 1 - \
> > -t wav -r 8000 -w -c 1 "`echo $i | sed -e 's/mp3$/wav/'`"
> 
> Quoted correctly:
> 
>   "`echo "$i" | sed -e 's/mp3$/wav/'`"
>
> A much simpler version of that if you know that $i ends with .mp3 is:
> 
>   "${i%.mp3}.wav"

Nice. I habitually use sed because most of the time there is much more
to do, like replacing spaces with underscores etc. And I have to thank
you Colin, because it has now become clear why my filename "repairs"
sometimes dont work. If it contains two space characters in a row and
the sed expression shall replace them with a single underscore for
example, it will not work without proper quoting because the two spaces
will become one when entering sed. Ive had lots of head scratching about
that :)

Regards
Matthias



Reply to: