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

 
 

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

Submitted by:  Roland Eggner <robiol262>
Submitted on:  Fri 30 May 2008 02:18:09 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.4.0Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

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

@jay
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 AdministratorIn charge of this item.
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:

PROBLEM:
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.

FEATURE REQUEST:
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Jun 2008 12:11:30 PM UTCjayStatusNone=>Wont Fix
      Assigned toNone=>jay
      Open/ClosedOpen=>Closed
    Mon 02 Jun 2008 04:56:49 PM UTCametzlerCarbon-CopyRemoved 20807=>-

    Back to the top


    Powered by Savane 3.1-cleanup1