This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Strange `find` syntax error in crosstool-ng


On Mon, 28 Jan 2008, Dave Korn wrote:
What version of find do you have running? I have

/artimi/software/firmware $ find --version
GNU find version 4.3.2
Features enabled: O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS CBO(level=0)

I have


$ find --version
GNU find version 4.1.20
$ cat /etc/issue
Red Hat Enterprise Linux WS release 4 (Nahant Update 6)
Kernel \r on an \m

$

I guess RH enterprise 4 is too ancient to know about the + feature; have to confess it's news to me too!

And in the info page I have:

8.1.4 Going back to -exec
-------------------------

There is indeed a more universal mechanism, which is a slight
modification to the `-exec' action.  The normal `-exec' action assumes
that the command to run is terminated with a semicolon (the semicolon
normally has to be quoted in order to protect it from interpretation as
the shell command separator).  The SVR4 edition of Unix introduced a
slight variation, which involves terminating the command with `+'
instead:

find /var/tmp/stuff -mtime +90 -exec /bin/rm {} \+

  The above use of `-exec' causes `find' to build up a long command
line and then issue it.  This can be less efficient than some uses of
`xargs'; for example `xargs' allows new command lines to be built up
while the previous command is still executing, and allows you to
specify a number of commands to run in parallel.  However, the `find
... -exec ... +' construct has the advantage of wide portability.  GNU
findutils did not support `-exec ... +' until version 4.2.12; one of
the reasons for this is that it already had the `-print0' action in any
case.

Odd language there: "the ... + construct has the advantage of wide portability ... [it was] not support[ed] until version 4.2.12". Perhaps they meant to say "does not have" instead of "has"?


Ah well: that explains my confusion, makes more sense.

I guess either the ./configure script needs to detect this, or we could just use the \; terminator, as actually we don't really need xargs like behaviour for rm! (This step runs briskly enough anyway.)

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]