Indeed, as @japyal states, there appears to be bug in the BSD version of grep
(which also affects OSX).
Workaround:
grep -f <(sed 's/.*/\\<&\\>/' match1) list
This dynamically encloses the strings in match1
in explicit word-boundary regex assertions, as if match1
had been defined as:
\<tt135\>
\<tt1122\>
\<tt1351\>
The net effect is the same as if -w
had been specified.