* Bug in grep -w (Digital)
@ 1997-11-24 17:19 Ken Williams
0 siblings, 0 replies; only message in thread
From: Ken Williams @ 1997-11-24 17:19 UTC (permalink / raw)
To: tru64-unix-managers
Hi there-
I've found what seems to be a pretty clear bug in grep. From the man page:
-w [Digital] Matches only if the expression is found as a separate word
in the text. A word is any string of alphanumeric characters (letters,
numerals, and underscores) delimited by nonalphanumeric characters
(punctuation or white space) or by the beginning or end of the line).
See ex.
But note this:
12:06pm% echo 'free' |grep -w e
free
It finds any double-occurrence at the end of a word:
12:08pm% echo 'garbagebigbig more words' | grep -w big
awefoijfbigbig more words
12:08pm% echo 'garbagebigbiggarbage more words' | grep -w big
<nothing - works correcly>
I haven't found any reference to this bug on the web - anyone have a fix?
A patch? We are working on a rather painful workaround:
12:15pm% echo 'free' |grep -Ei '(^|[^a-z0-9])(e)([^a-z0-9]|$)'
<no output - correct>
We're using Digital Unix version 4.0 . Thanks in advance.
-Ken Williams, The Math Forum
ken@forum.swarthmore.edu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-11-24 17:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-11-24 17:19 Bug in grep -w (Digital) Ken Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox