bugfindutils - Bugs: bug #26057, find -execdir {} + gives...

 
 

bug #26057: find -execdir {} + gives unexpected results

Submitted by:  Don <dmca>
Submitted on:  Tue 31 Mar 2009 11:21:14 AM UTC  
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Duplicate
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Tue 31 Mar 2009 11:26:14 AM UTC, comment #1: 

Actually, scrap that. This is just just a duplicate of bug #19593

(I had read the bug before posting, but it didn't sink into my head properly. Apologies for the duplication)

Don <dmca>
Tue 31 Mar 2009 11:21:14 AM UTC, original submission:  

-execdir {} + and -execdir {} \; give identical results when -exec {} + and -exec {} \; give different results. For example:

If I construct a directort structure such that:

user@host:~$ ls -R
.:
dir1
dir2
dir3

./dir1:
file1a
file1b
file1c

./dir2:
file2a
file2b
file2c

./dir3:
file3a
file3b
file3c

-exec {} + will run a command on each file simultaneously:

user@host:~$ find . -iname 'file*' -exec echo {} +
./dir2/file2a ./dir2/file2b ./dir2/file2c ./dir3/file3c ./dir3/file3a ./dir3/file3b ./dir1/file1b ./dir1/file1a ./dir1/file1c

Whereas -exec {} \; will echo each file individually.

-execdir {} + runs the echo command on each file individually (from within the subdirectories) and not (as I would have thought is meant to be the case) three times, once per subdirectory:

user@host:~$ find . -iname 'file*' -execdir echo {} +
./file2a
./file2b
./file2c
./file3c
./file3a
./file3b
./file1b
./file1a
./file1c

The output from find . -iname 'file*' -execdir echo {} \; is identical.

Appologies if I'm not being clear or if I'm making a basic error somewhere. I'm pretty new to using find and am not a complete expert using the shell.This is version 4.4.0 of find

 
Don <dmca>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericb (Updated the item)
  • -email is unavailable- added by dmca (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-03-31 ericb StatusNone => Duplicate
        Open/ClosedOpen => Closed
    2009-03-31 ericb Dependencies- => Depends on bugs #19593

    Back to the top


    Powered by Savane 3.6