Re: Bash recursing mp3.2.ogg conversion

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

 



On Fri, Sep 02, 2005 at 10:48:55PM +0100, Dave Mitchell wrote:
> Date: Fri, 2 Sep 2005 22:48:55 +0100
> From: Dave Mitchell <davem@xxxxxxxxx>
> To: For users of Fedora Core releases <fedora-list@xxxxxxxxxx>
> Subject: Re: Bash recursing mp3.2.ogg conversion
> Reply-To: For users of Fedora Core releases <fedora-list@xxxxxxxxxx>
> 
> On Fri, Sep 02, 2005 at 04:29:34PM -0400, Rodolfo Alcázar wrote:
> > On Fri, 2005-09-02 at 15:23 -0500, Bill Gradwohl wrote:
> > > On Fri, 2005-09-02 at 15:55 -0400, Rodolfo Alcázar wrote:
> > > > for f in $(find . -name "*mp3"); do command-mp3-2-ogg $f; done
> > > Put double quotes around the $f as - "$f" - to force file names that
> > > include spaces to be treated properly.
> > 
> > NOP. See what hapens with an echo, so you can see the output.
> > 
> > $ for f in $(find . -name "*mp3"); do echo command-mp3-2-ogg "$f"; done
> > 
> > command-mp3-2-ogg ./Sting/Englishman
> > command-mp3-2-ogg In
> > command-mp3-2-ogg New
> > command-mp3-2-ogg York.mp3
> > command-mp3-2-ogg ./Sting/The
> > command-mp3-2-ogg Hounds
> > command-mp3-2-ogg Of
> > command-mp3-2-ogg Winter.mp3
> > 
> > Any other suggestion?
> 
> find . -name '*.mp3' | xargs -i= echo command-mp3-2-ogg =

Do recall the gnu -print0 flag for find and -0 flag for xargs.

   find . -name '*.mp3' -print0 | xargs -0 command-mp3-2-ogg

The $( some subshell generates list ) can have a side effect
where the command line max input runs out of space.  This is
solved classicly with find and xargs.  The newer problems of 
ill behaved file names is solved with -print0  and -0


-- 
	T o m  M i t c h e l l 
	Found me a new place to hang my hat :-)
	Found me a cable too.



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux