[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SAGE] LDAP Migration Question
On Mon, 2007-07-02 at 14:56 -0400, Brandon S. Allbery KF8NH wrote:
> On Jul 2, 2007, at 14:15 , Brad Knowles wrote:
>
> > On 7/2/07, Nick Stoughton wrote:
> >
> >> If your find is POSIX conforming, then you can do
> >>
> >> find / -owner $old_uid -exec chown $2 {} +
> >
> > Now we not only get to nuke people for excessive unnecessary use of
> > "cat", now we can whack them for unnecessary use of xargs....
>
> xargs still wins, because -exec does a fork/exec for each file while
> xargs does them in batches.
Nope ... you didn't read my mail!
I'll quote from the Linux man page, since it is a little easier to
understand than the standardeze in POSIX (but you can read the original
POSIX version at
http://www.opengroup.org/onlinepubs/009695399/utilities/find.html if you
want):
-exec command {} +
This variant of the -exec option runs the specified
command on the selected files, but the command line is built by
appending each selected file name at the end; the total number of
invocations of the command will be much less than the number of matched
files. The command line is built in much the same way that
xargs builds its command lines. Only one instance of ’{}’ is allowed
within the command. The command is executed in the starting directory.
--
Nick