A reader of my new book Wicked Cool Shell Scripts pointed out that the capability of testing a file permission with find using the ‘+’ notation is GNU-specific.
Specifically, in script #49, findsuid, the line:
for match in $(find /bin /usr/bin -type f -perm +4000 -print)
might need to be tweaked on some Unix versions to be -perm -4000, which will produce the same basic results.
That would look like this:
for match in $(find /bin /usr/bin -type f -perm -4000 -print)
Hope that helps clarify things!