is grep broken (4.2)

leed leed at orstcs.UUCP
Fri Aug 10 03:04:00 AEST 1984


""
Let us not forget that grep also accepts the meta-characters '<' and '>' for
word boundry matching.  Yes, it's true that the dictionary is set up with
one word per line, but in the more general sense, one could search using:

	grep '\<am.le\>' any_file_name

And this would find 'ample', but not 'trample'.  The reason for needing both
quotes and the back-slash is that the quotes are to satisfy the shell
that the commands are executed in, and the back-slashes are to tell grep that
the less-than and greater-than signs are meta-characters.  Without the back-
slashes, grep thinks you want to match on a real less-than or greater-than
sign!

>From the never-stationary soul of:	the masked non-system manager (:~:)

(otherwise known as: ...!hplabs!hp-pcd!orstcs!leed  -- W. Lee Duncan)



More information about the Comp.unix mailing list