bin/171725: awk(1) does not support word-boundary metacharacters
Devin Teske
dteske at FreeBSD.org
Tue Sep 18 00:00:25 UTC 2012
>Number: 171725
>Category: bin
>Synopsis: awk(1) does not support word-boundary metacharacters
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 18 00:00:21 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Devin Teske
>Release: FreeBSD 9.0-RELEASE i386
>Organization:
FIS Global, Inc.
>Environment:
FreeBSD push900.vicor.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 root at obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The awk(1) manual describes (quote) "regular expressions are as in egrep; see grep(1)."
This leads one to believe that awk(1) supports both basic REs and extended REs.
A discrepancy/gap has been found in this stated coverage.
one-true-awk (our awk(1)) does not support the word-boundary metacharacters (\< and \>) for matching beginning- and ending-of-word.
>How-To-Repeat:
$ echo xxxa | awk '/xxx\>/{print}'
### this produces no output, as-is expected since
### the word "xxxa" does not end in "xxx"
$ echo xxx | awk '/xxx\>/{print}'
### this too produces no output, indicating that
### \> is not a valid metacharacter for "end-of-word"
>Fix:
There are two proposed solutions.
1. Add a note to the awk(1) manual stating it does not support all RE metacharacters (note that '\<' and '\>' are valid both as BRE and ERE).
or
2. Enhance awk(1) to support these BRE/ERE metacharacters so that the awk(1) manual is accurate without a patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list