Carla Schroder said:
> hiya ace audio-heads,
>
> Being as how I'm a sucky scripter, though improving through diligence,
> hard
> work, and pestering people who are good at scripting, I was wondering if
> there was a way to improve this process. I want to do batch file
> conversions
> in sox, it has no built-in batch functions. This command works OK:
>
> $ for i in `ls *.wav`; do echo -e "$i"; sox $i $i.cdr; echo -e "$i.cdr";
> done
>
> But the results are like this:
>
> KDE_Logout_new.wav
> KDE_Logout_new.wav.cdr
> new_game.wav
> new_game.wav.cdr
>
> So, sed to the rescue:
>
> $ for FILE in *.wav ; do ( sox $FILE `echo $FILE.cdr | sed -e 's/\.wav//'`
> ) ;
> done
>
> $ ls
> KDE_Logout_new.cdr
> new_game.cdr
>
> Is there a more streamlined way to do this? or a better utility than sox?

Try using basename
Here's the example:

for i in `ls *.wav`; do echo -e "$i"; sox $i `basename $i .wav`.cdr; done

-Ken
_______________________________________________
PDXLUG mailing list
[EMAIL PROTECTED]
http://pdxlug.org/mailman/listinfo/pdxlug

Reply via email to