bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #18554] feat req: -exec cmd {} more args +


From: James Youngman
Subject: [bug #18554] feat req: -exec cmd {} more args +
Date: Wed, 20 Dec 2006 17:20:12 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060830 Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-1)

Follow-up Comment #3, bug #18554 (project findutils):

OK, I have now spent some time re-reading the standard at
http://www.opengroup.org/onlinepubs/009695399/utilities/find.html.

The last thing before the "+" must be {}.   That {} will be replaced by an
aggregated set of pathnames.     Hence there is no possibility to support
something like "find . -exec foo {} bar +" while conforming to the standard.

This begs the question as to whether something like "find a b  -exec echo {}
MARK {} +" should work, and if so how.  The standard states "If more than one
argument containing only the two characters "{}" is present, the behavior is
unspecified.".  So anything could happen, really.   What happens is that find
issues an error message complaining of inappropriate usage and exits without
doing anything.

So the result is that find supports "find .... -exec .... {} +" but the final
+ must be immediately preceded by {}.  While find could support a {} earlier
in the command line, it doesn't currently support that, thet feature would
not be useful to you as far as I can see, and the standard allows the current
behaviour.

So, I think POSIX disallows the usage you would like, and the closest
conforming usage pattern that find could support doesn't appear to help you. 


As far as I understand things though you want to be able to do something like
this:

find startpoint -tests ... -exec rsync {} /dest +

The closest thing I can think of to what you want is this:

find a b -print0 | rsync --files-from=- --from0 /dest

Some versions of xargs support the use of both -I and -L in such a way that
{} can expand to more than one filename.  GNU findutils doesn't support that.
 That construct could perhaps be used to do what you want.  I suggest you join
the findutils mailing list and start a discussion about what 

printf "funny\nscary\n" | xargs -I _  -L10 echo hello _ world

should do.  On other words, should -L reverse the effect of -I?  Please join
the list before sending the mail, or you may miss some of the responses.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?18554>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]