Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: script within find



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