bugfindutils - Bugs: bug #23439, "find dir -sometests -exec cp...


bug #23439: "find dir -sometests -exec cp '{}' destination/ +" FAILS, placeholder must TERMINATE command

Submitter:  Roland Eggner <robiol262>
Submitted:  Fri 30 May 2008 02:18:09 PM UTC
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.4.0 Fixed Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Tue 24 Jun 2008 04:52:59 PM UTC, comment #3: 

thanks for the hint #18554 where topic is discussed in detail, sorry that I missed it

many thanks for this INGENIOUS trick .. it is highly useful for this and other tasks
I wrote a lot of bash scripts and until today did not know that bash expands positional parameters in this case .. life is learning ;)

I prefer man pages (whole content on a single page, word wrapping matches screen width), avoid using info pages as long as possible because the short lines and short pages are a sort of stuttering to my taste .. thus missed your diligent work on Texinfo where you elaborated the issue

Roland Eggner <robiol262>
Sat 21 Jun 2008 12:11:30 PM UTC, comment #2: 

A better technique (using -exec with "sh -c") is also explained in the Texinfo manual for find.

James Youngman <jay>
Project Administrator
Mon 02 Jun 2008 04:56:35 PM UTC, comment #1: 

This has come up previously in <http://savannah.gnu.org/bugs/?18554>. Posix specifies the syntax as it is implemented in GNU findutils.
 "-exec utility_name [argument ...] {} +"

cu andreas

Andreas Metzler <ametzler>
Fri 30 May 2008 02:18:09 PM UTC, original submission:  

On commands like
find sourcedirs  -sometests  -exec  cp '{}' destinationdir/ +
find complains
find: missing argument to `-exec'
because the placeholder '{}' must TERMINATE the command called by find.

Usability of find would be improved, if
(a)  above mentioned error message would be more instructive,
(b)  the currently redundant placeholder could be omitted or even better,
(c)  if the placeholder would be really functional and allow find usage like my example above.

WORKAROUNDS are known but they lag the advantages of find operator '+':
use trailing \; instead of + or
use find ... -print0 | xargs -0 ...

Roland Eggner <robiol262>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by robiol262 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-06-21 jay StatusNone Wont Fix
        Assigned toNone jay
        Open/ClosedOpen Closed
    2008-06-02 ametzler Carbon-CopyRemoved 20807 -

    Back to the top

    Powered by Savane 3.9