3 ms·
The other big gotcha that took a while to sink in was find -name "foo*" -or -name "*bar" -print which should actually be find \( -name "foo*" -or -name "
by shabble 15y ago
The other big gotcha that took a while to sink in was
find -name "foo*" -or -name "*bar" -print
which should actually be
find \( -name "foo*" -or -name "*bar" \) -print
to do what you might expect (print things matching beginning with foo or ending with bar)
Without the parens, it gets interpreted as
-name "foo*" -or ( -name "*bar" -and -print ),
and hence only prints things that match the latter predicate.