Gentoo Archives: gentoo-dev

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Re: [gentoo-commits] gentoo-x86 commit in app-misc/note: ChangeLog note-1.3.3.ebuild
Date: Tue, 16 Oct 2007 00:01:20
Message-Id: 1192492093.31537.2.camel@su.perronet.esiee.net
In Reply to: [gentoo-dev] Re: Re: [gentoo-commits] gentoo-x86 commit in app-misc/note: ChangeLog note-1.3.3.ebuild by Steve Long
1 Le lundi 15 octobre 2007 à 23:43 +0100, Steve Long a écrit :
2 > Roy Marples wrote:
3 > The unintended globbing is indeed unsafe, in the general case. I'd do this:
4 >
5 > find "$D" -type f -name '*'"$v"'.*pm' -exec rm {} +
6 >
7 > The shell will still treat that all as one argument (this method is
8 > typically used to insert variables into awk commands, or sed ones which
9 > use ".) The + will make the command execution more efficient for commands
10 > that take multiple filenames. The one caveat with + is that the {} must
11 > appear at the end of the command.[3]
12
13 I haven't reread the fine mans for a while but iirc, + could lead you to
14 hit the argument buffer limit of your shell. xargs has --max-args to get
15 around that and is also way faster than any -exec variant (at least
16 that's what the bench I did on a PIV2.6Ghz showed me about 4 months ago)
17
18 --
19 Gilles Dartiguelongue <eva@g.o>
20 Gentoo

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-dev] Re: Re: Re: [gentoo-commits] gentoo-x86 commit in app-misc/note: ChangeLog note-1.3.3.ebuild Steve Long <slong@××××××××××××××××××.uk>