Using the -w option doesn't necessarily return a whole word.
For example, if I run /usr/xpg4/bin/grep -w "bird" myfile,
"birdie" will not be returned, but any of the following will:
bird#
bird@
bird$
..etc.
This will cure it, at the cost of longer execution time.
grep "(^|[[:space:]])bird($|[[:space:]])" myfile
Why doesn't -w work as expected???
For example, if I run /usr/xpg4/bin/grep -w "bird" myfile,
"birdie" will not be returned, but any of the following will:
bird#
bird@
bird$
..etc.
This will cure it, at the cost of longer execution time.
grep "(^|[[:space:]])bird($|[[:space:]])" myfile
Why doesn't -w work as expected???