bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Don
Subject: [bug #26057] find -execdir {} + gives unexpected results
Date: Tue, 31 Mar 2009 11:21:16 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8

URL:
  <http://savannah.gnu.org/bugs/?26057>

                 Summary: find -execdir {} + gives unexpected results
                 Project: findutils
            Submitted by: dmca
            Submitted on: Tue 31 Mar 2009 11:21:14 GMT
                Category: find
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None

    _______________________________________________________

Details:

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

If I construct a directort structure such that:

address@hidden:~$ 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:

address@hidden:~$ 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:

address@hidden:~$ 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
  






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?26057>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]