bugfindutils - Bugs: bug #32519, Back-quoted `uuidgen` in -exec...

 
 

bug #32519: Back-quoted `uuidgen` in -exec part is not executed everytime

Submitter:  Floyd Wan <fwoncn>
Submitted:  Thu 17 Feb 2011 05:13:43 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Invalid
Privacy:  Public Assigned to:  ericb
Originator Name:  Open/Closed:  Closed
Release:  4.4.2 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 17 Feb 2011 05:41:51 PM UTC, comment #1: 

Your problem is that you want to run multiple commands on each -execdir (both unzip and uuidgen), but -execdir can only run a single command.  The solution is to wrap things in yet another command - a shell that can then exec your multiple commands.


find -name '*.zip' -execdir sh -c 'unzip "$@" -d `uuidgen -r`' sh {} \;


Eric Blake <ericb>
Group administrator
Thu 17 Feb 2011 05:13:43 PM UTC, original submission:  

Here is my command:
find -name *.zip -execdir unzip {} -d `uuidgen -r` \;
I'm expecting it to unzip all zip files and put the extracted files into different directories whose names are generated by uuidgen. But the back-quoted uuidgen is apparently not exectued everytime. As a result, I got prompts asking me to avoid the same name.
This command which does nothing meaningful:
find -name *.zip -exedir uuidgen -r \;
uuidgen here is executed everytime, however.

Floyd Wan <fwoncn>

 

(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 ericb (Posted a comment)
  • -email is unavailable- added by fwoncn (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-02-17 ericb StatusNone Invalid
        Assigned toNone ericb
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code