On Thursday 29 July 2010 05:27:35 Mart Frauenlob wrote:
> On 29.07.2010 07:17, Boyd Stephen Smith Jr. wrote:
> > On Wednesday 28 July 2010 21:37:44 Karl Vogel wrote:
> >>     I need to think before posting.  I didn't mention that I have
> >>     FreeBSD, Linux, and Solaris boxes, and unfortunately I can't
> >>     guarantee the same access to GNU find.  I can install xargs if the
> >>     system version doesn't recognize the "-0" option, so I usually end
> >>     up scripting for the lowest common denominator.
> > 
> > In that case, you'll have to be very careful in order to handled file
> > names that contain IFS characters or newlines:
> > 
> > find "$MAGDIR" -name "*.[zZ][iI][pP]" -exec \
> > 
> >     sh -c 'handle_single_file "$1"' ignored {} \;
> > 
> > That will work on any POSIX system, or most systems with POSIX-conforming
> > find and sh.  You *may* have to specify full paths to the
> > POSIX-conforming find and sh commands.
> 
> yes, '-exec command {} +' is also POSIX, but newer (collects argument
> list similar to xargs).

In that case, you may be able to avoid spawning quite as many processes by 
doing something like:

find "$MAGDIR" -name "*.[zZ][iI][pP]" -exec \
        sh -c 'handle_many_files "$@"' ignored {} +

Note that I used the "-exec cmd \;" form explicitly because the "-exec cmd +" 
form is newer.

> I think using '-type f' would not be wrong either, as otherwise we would
> match directories also.

Probably not a bad idea.
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
b...@iguanasuicide.net                  ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to