This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: find -execdir command executed in wrong directory
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 12/5/2006 8:20 PM, Eric Blake wrote:
> David Rothenberger <daveroth <at> acm.org> writes:
>
>>
>> "find -execdir" seems to be executing the command in the wrong
>> directory. If the file is in /tmp/a/b/c, the command is executed with
>> the current directory /tmp/a/b instead of /tmp/a/b/c. oldfind does the
>> right thing.
>
> Thanks for the report. I'm forwarding it upstream, and hopefully a patch will
> be available soon. The bug only affects the "-execdir {} +" version (you can
> still use the less efficient "-execdir {} \;").
>
I've encountered another similar problem. This one seems to be triggered
by a directory that comes after some files in a directory.
% cygcheck -cd findutils
Cygwin Package Information
Package Version
findutils 4.3.2-3
% mkdir -p /tmp/a/b/c
% touch /tmp/a/b/a{1,2}
% find /tmp/a -type f -print -execdir pwd {} +
/tmp/a/b/a1
/tmp/a/b/a2
pwd: ignoring non-option arguments
/tmp/a/b/c
The last output should have been /tmp/a/b, not /tmp/a/b/c.
% oldfind /tmp/a -type f -print -execdir pwd {} +
/tmp/a/b/a1
/tmp/a/b/a2
pwd: ignoring non-option arguments
/tmp/a/b
If /tmp/a/b/c is removed, it works correctly.
% rmdir /tmp/a/b/c
% find /tmp/a -type f -print -execdir pwd {} +
/tmp/a/b/a1
/tmp/a/b/a2
pwd: ignoring non-option arguments
/tmp/a/b
It also works correctly if the files come after the directory.
% mkdir /tmp/a/b/a0
% find /tmp/a -type f -print -execdir pwd {} +
/tmp/a/b/a1
/tmp/a/b/a2
pwd: ignoring non-option arguments
/tmp/a/b
- --
David Rothenberger spammer? -> spam@daveroth.dyndns.org
GPG/PGP: 0x92D68FD8, DB7C 5146 1AB0 483A 9D27 DFBA FBB9 E328 92D6 8FD8
Love cannot be much younger than the lust for murder.
-- Sigmund Freud
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEVAwUBRX9kDr3xOW8bc2dhAQiVtgf/cxP7ntgE3C+/zRARKwRO0kOxyIldRRsr
7/hdyt74yps87+NtTjm3xHAwxf7oWvJyDhJxhxsR6tj57oKYRlLqIwoyNg8PZu5g
TwprPLDIDyd0WTfkHl1r1AJnxVAvQesAOO3JEjcbDLvFDWU1JNYj1SEJw6RI3NCG
UwnD/yCLCP4IRIOT/Ok3ituSygb5JPtoMcvWV4C1WJK6OPYv7gt7etwpBohIH4zm
/w+83kLdWn5n9T+kEYW8dsrN9NH3OblAj2byg9jjuwIJ79SO6f9V3kor8OsU9Le1
LwQsqoLuLcroS/27kgE9hUCa8Q8XdFm5wATIotc6lYurTd0mYG0x5A==
=iyjG
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/