bug-findutils
[Top][All Lists]
Advanced

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

[bug #59083] enhancement: find -D exec


From: anonymous
Subject: [bug #59083] enhancement: find -D exec
Date: Tue, 8 Sep 2020 17:07:25 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0

URL:
  <https://savannah.gnu.org/bugs/?59083>

                 Summary: enhancement: find -D exec
                 Project: findutils
            Submitted by: None
            Submitted on: Tue 08 Sep 2020 09:07:23 PM UTC
                Category: find
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Philip Rowlands
        Originator Email: phr+findutils@dimebar.com
             Open/Closed: Open
                 Release: None
         Discussion Lock: Any
           Fixed Release: None

    _______________________________________________________

Details:

The snippet which brought this to my attention is


if find -name '*.txt' -exec grep somestring {} +; then echo somestring found;
fi


which is fragile because, depending how many greps are launched, some may find
a match (and exit 0), some may not (and exit 1), and find reasonably takes a
worst-case exit status from the commands exec'd.

What made this harder to debug was the lack of useful output from find -D
exec; the only output controlled by DebugExec is from
show_outstanding_execdirs().

It seems launch() is the right place to add more debug output, perhaps before
fflush() / after waitpid().

For example "launching 'grep' with 4000 pathnames" and "process 'grep' exited
with status 1" messages in the debug output would make it much clearer.

If there's support for this, I can try to craft a patch.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59083>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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