Hi, for me it looks like "find" returns an invalid exit code when "-exec" returns an error:
$ mkdir /tmp/find-test $ touch /tmp/find-test/scripts{1..10}.sh $ touch /tmp/find-test/text{1..10}.txt $ find /tmp/find-test -name '*.sh' -exec chmod 755 \; \ && echo "find succeed" || echo "find failed" Yes, I am missing the "{}" but that's how I encounter the bug. Output: > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > chmod: missing operand after ‘755’ > Try 'chmod --help' for more information. > find succeed I expected "find failed" ("find" should have ended with non-zero exit code). And yes, "chmod 755" returns an error: $ chmod 755 chmod: missing operand after ‘755’ Try 'chmod --help' for more information. $ echo $? 1 $ find -version find (GNU findutils) 4.5.14 Packaged by Gentoo (4.5.14-r1) Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. -Thomas