[Malvern] Run a command recursivly in each folder?

Gary V. Vaughan gary at gnu.org
Fri Sep 10 14:32:17 BST 2004


> On Thu, Sep 09, 2004 at 08:14:09PM +0100, Robin Wilson wrote:
>>Is there a way to run a command recursively in each folder below the current
>>folder?


>From the shell prompt:

$ find $HOME/mp3 -name '*.mp3' -exec mp3toogg {} \;

...assuming you have a script that takes the name of an mp3 file and generates
an ogg from it.

If the script takes a list of files, then you can also do it like this:

$ mp3toogg `find $HOME/mp3 -name '*.mp3' -print`

Be careful you use the correct quotes for either of these.

Cheers,
	Gary.
-- 
Gary V. Vaughan      ())_.  gary@{lilith.warpmail.net,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://mailman.lug.org.uk/pipermail/malvern/attachments/20040910/cc4253f5/signature.bin


More information about the Malvern mailing list