bug-findutils
[Top][All Lists]
Advanced

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

[bug #54730] Add additional valuable example of find -quit


From: INVALID.NOREPLY
Subject: [bug #54730] Add additional valuable example of find -quit
Date: Tue, 25 Sep 2018 22:34:53 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36

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

                 Summary: Add additional valuable example of find -quit
                 Project: findutils
            Submitted by: jidanni
            Submitted on: Wed 26 Sep 2018 02:34:51 AM UTC
                Category: documentation
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.6.0
           Fixed Release: None

    _______________________________________________________

Details:

On man find we see:

       -quit  Exit  immediately.   No  child  processes will be left running,
but no more paths specified on the command
              line will be processed.  For example, find /tmp/foo /tmp/bar
-print -quit will print only  /tmp/foo.   Any
              command lines which have been built up with -execdir ... {} +
will be invoked before find exits.  The exit
              status may or may not be zero, depending on whether an error has
already occurred.

Also add an example:

Indeed this can be used to quit immediately if any -exec has an error:

$ find \( -exec perl -e if {} \; -o -quit \)
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.

Instead of the error repeating 1000 times.
(The error message came from perl.)





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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