title: find: How to force a non-zero exit status
body: <p>I have glossed over the man page for find and <code>-quit</code> seems to partly do what I want, except it will only cause <code>find</code> to return non-zero if an error has occurred.  So how can <code>find</code> be forced to return non-zero or at least be spoofed into returning non-zero in a way that is readable to maintainers?  So far I have this example:</p>
  
  <pre><code>$ find . -maxdepth 2 -type f \( -exec echo {} \; -o \( -printf "FAIL\n" -a -quit \) \)
  ./scooby
  ./shaggy
  ./velma
  ./daphne
  ./fred
  $ echo $?
  0
  </code></pre>
  
  <p>But if I replace the echo with a call to false, I get the desired early exit, but no non-zero exit code:</p>
  
  <pre><code>$ find . -maxdepth 2 -type f \( -exec false {} \; -o \( -printf "FAIL\n" -a -quit \) \)
  FAIL
  $ echo $?
  0
  </code></pre>
  
  <p>Update:</p>
  
  <p>I am trying to get find to return non-zero when <code>-exec</code> returns false, i.e. the command that executed returned non-zero.  Currently, <code>find</code> just converts the non-zero <code>-exec</code> call into a boolean state to be used as part of a <code>find</code> expression.</p>
  
  <pre><code>$ find . -maxdepth 2 -type f \( -exec chmod a+x {} \; -o \( -printf "FAIL\n" -a -quit \) \)
  </code></pre>
  
  <p>This currently will never return non-zero if the chmod fails.  I want to be able to return non-zero if the chmod fails, as well as exit early, which it already does using <code>-quit</code>.</p>