[Gllug] batch convert

Richard Cohen richard at vmlinuz.org
Wed Jan 29 20:53:21 UTC 2003


On Thu, 30 Jan 2003, Jonathan Harker wrote:

> On Wednesday 29 Jan 2003 11:44 am, Paul Nasrat wrote:
> > On Wed, Jan 29, 2003 at 11:18:45AM +1300, Jonathan Harker wrote:
> > > On Wednesday 29 Jan 2003 10:29 am, Stig spake thus:
> > > > It is easiest to be sure by using find, thus:
> > > >
> > > > 	find ~/music -name "*.mp3" -exec resample_mp3_application "{}" ";"
> > >
> > > Cool, but if I needed to do something more tricky, how do I use the
> > >
> > > for f in $files; do
> >
> > something to "$f";
> > done
> >
> > Should do the trick.
>
> Ah, but it doesn't.
>
> If I had these two files:
>
> ABBA - Money Money Money.mp3
> Shostakovich - Symphony No. 11, II. Allegro.mp3
>
> and a loop:
>
> for f in $files; do ... done

A much neater way, IMHO, is something like this:

ls *.mp3 | while read ; do something to $REPLY ; done

> then $f would be:
>
> ABBA
> -
> Money
> Money
> Money.mp3
> Shostakovich
> -
> Symphony
> No.
> 11,
> Allegro.mp3
>
> This is bad. I've tried fiddling with "", escaping with \, to no avail. I gave
> up in the end and did it by hand.
>
> Tet's trick of putting them in a file and going head -1 would work though.
> Thanx Tet!
>
> Luv Jon

Cheers
Richard

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list