Running a command on all file occurences in a directory tree
Fraser Campbell
fraser-eicrhRFjby5dCsDujFhwbypxlwaOVQ5f at public.gmane.org
Fri Oct 8 23:13:48 UTC 2004
On Friday 08 October 2004 18:48, Chris F.A. Johnson wrote:
> So long as there are no filenames containing newlines:
>
> find . -type f -name "*,jpg" |
> while IFS= read -r FILENAME
> do
> convert "$FILENAME" -resize 425 "$FILENAME"
> done
Why not just:
find . -type f -name \*.jpg | while read file; do
convert "$file" -resize 425 "small-$file"
done
My question I guess is what's the difference between
"while IFS= read -r file" and "while read file"?
Also I'd think input and output files should be different on the conver
command, though I'm not sure what op wanted.
--
Fraser Campbell <fraser-Txk5XLRqZ6CsTnJN9+BGXg at public.gmane.org> http://www.wehave.net/
Georgetown, Ontario, Canada Debian GNU/Linux
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list