bugfindutils - Bugs: bug #21373, [Feature req] Option to manipulate...

 
 

bug #21373: [Feature req] Option to manipulate paths before {} expansion.

Submitter:  None
Submitted:  Fri 19 Oct 2007 09:39:22 AM UTC
   
 
Category:  find Severity:  1 - Wish
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  jay
Originator Name:  Peter Mogensen Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.2.27
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 24 Nov 2007 11:23:42 AM UTC, comment #2: 

Peter writes:

However.... I found out that find actually supports this via -printf, so
please close the feature request.


find lib/perl/ -name '*.pm' -printf "%P\n" | xargs -l1

Does what I want. Sorry for the inconvenience.


So, closing...

James Youngman <jay>
Group administrator
Sat 17 Nov 2007 11:20:05 AM UTC, comment #1: 

Why not just use
find ./lib -name '*.pm' -print0 |
 perl -0ne 's/([^\/]*\/){2}//; print;' |
 xargs -r0 ...

James Youngman <jay>
Group administrator
Fri 19 Oct 2007 09:39:22 AM UTC, original submission:  

When using -exec {}, find replaces {} with either an absolute path or a path relative to the current directory. Some times you need a path relative to the subdirectory you're searching in.
Example:

Your say
find ./lib -name '*.pm' -exec ... {} \;

And you need {} to expand to:
Text/Glyffer.pm
XML/Paffer.pm

And not to:
./lib/Text/Glyffer.pm
./lib/XML/Paffer.pm

An option like the -p for the patch program to control {} expansion would be nice.


Anonymous

 

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

Attach Files:
   
   
Comment:
   

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 None (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
    2007-11-24 jay Severity3 - Normal 1 - Wish
        StatusNone Works For Me
        Assigned toNone jay
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code