On Thu, 2003-10-09 at 15:44, HaywireMac wrote:
> On Sat, 04 Oct 2003 23:36:28 -0700
> Jack Coates <[EMAIL PROTECTED]> uttered:
> 
> > hell, this is a one-liner :-)
> > 
> > for i in `ls *.wav`; do lame -buncha -options $i; done
> 
> alias that sucker in your .bashrc like this:
> 
> function mp3enc() { for i in `ls *.wav`; do lame -buncha -options $i;
> done }
> 
> and in reverse:
> 
> function mp3dec() { for i in *.mp3; do lame --decode $i `basename $i
> .mp3`.wav; done; }
> 
> the only problem you might run into is if the filenames have spaces, so,
> do this first:
> 
> for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`;done;

Being a total newb when it comes to shell programing, I found this to be
a great tip (having just spent considerable time writing a much longer
script to do the same thing *).

Is there an equally simple way to truncate file names to remove unwanted
characters from the end?  I of course would never dream of downloading
anything using gnutella, but should someone else do this and end up with
lots of files ending in ".OK", it would be nice to process them in a
similar way.  Just theoretically of course.

TIA
Brian

* It didn't work either!


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to