tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Ken Williams <ken () forum ! swarthmore ! edu>
To: tru64-unix-managers
Subject: Bug in grep -w (Digital)
Date: Mon, 24 Nov 1997 17:19:12 +0000	[thread overview]
Message-ID: <96078619210654.tru64-unix-managers.marc@archive.invalid> (raw)

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

                 reply	other threads:[~1997-11-24 17:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox