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