[Top] [All Lists]

Re: help - executing a pipeline from find - exec

Subject: Re: help - executing a pipeline from find - exec
From: Tony van der Hoff
Date: Sun, 03 Jan 2010 17:42:19 +0000
Newsgroups: uk.comp.os.linux

Mike Civil wrote:
I thought I could use find:
find . -maxdepth 1 -name '*.jpg' -exec 'djpeg {} | \
cjpeg -qual 25 > small/{}' \;

You need to play around with execing a shell with args (or simpler put
your commands in a shell script and call that in exec with the filename
as the argument), however in the the best Usenet tradition could I
suggest using mogrify (part of ImageMagick) to alter the files in place,
eg using your find :-

find . -maxdepth 1 -name '*.jpg' -exec mogrify -quality 25 {} +

The + will cause find to run each mogrify with as many files as possible.

Ah, yes, that works. Well, I used 'convert' rather than 'mogrify' to
retain the originals.

Thanks for your help.
Tony van der Hoff        | mailto:[email protected]
Buckinghamshire, England |

<Prev in Thread] Current Thread [Next in Thread>