From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078619210654.tru64-unix-managers.marc@archive.invalid> From: Ken Williams Date: Mon, 24 Nov 1997 17:19:12 +0000 To: tru64-unix-managers Subject: Bug in grep -w (Digital) X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078619210654 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 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]|$)' We're using Digital Unix version 4.0 . Thanks in advance. -Ken Williams, The Math Forum ken@forum.swarthmore.edu