Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: script within find
- X-seq: zsh-users 11448
 
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
 
- To: Alexy Khrabrov <deliverable@xxxxxxxxx>
 
- Subject: Re: script within find
 
- Date: Wed, 25 Apr 2007 17:52:14 -0400
 
- Cc: zsh-users@xxxxxxxxxx
 
- In-reply-to: <7c737f300704251214r602027a4u2d3533370fd317a9@xxxxxxxxxxxxxx>
 
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
 
- References: <7c737f300702232339keaffa58g99b1f51de74e0c8a@xxxxxxxxxxxxxx> <20070224100809.GA4828@xxxxxxxxxxxxxxx> <7c737f300704251214r602027a4u2d3533370fd317a9@xxxxxxxxxxxxxx>
 
Alexy Khrabrov sent me the following 2.2K:
> A while ago, Stephane suggested a terrific script on doing things
> right inside find's exec.
> I'm using that magic advice and it works, fantastic!  Still it's a bit
> of a mystery to me.  Why do we need {} {} twice -- although there's
> only one parameter reference to $1?
> 
> Also, how would I generalize it for two commands inside the script?
> Here's an example.  I want to convert a bunch of .tif files to .jpg's.
> The original tifs reside in certain directory structure which should
> be preserved in the target directory.
[...]
> The command to do a single conversion is
> 
> convert -quality 100 dir1/A.tif /jpgs/dir1/A.jpg
I think it'd be simpler to do something like:
   $ cp -r dir1 /jpgs
   $ mogrify -format jpg /jpgs/**/*.tif
Mogrify is also part of the ImageMagick suite, but does the conversion
in place.
This doesn't help you with your general find question, however.
-- 
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author