Subject: misc/8388: wtf(6) matches regular expressions, not literals
To: None <gnats-bugs@gnats.netbsd.org>
From: Antti Kantee <pooka@iki.fi>
List: netbsd-bugs
Date: 09/12/1999 14:16:36
>Number:         8388
>Category:       misc
>Synopsis:       wtf should match literals
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 12 14:05:01 1999
>Last-Modified:
>Originator:     Antti Kantee
>Organization:
>Release:        -current supped 12th Sep
>Environment:
NetBSD 1.4K

>Description:
babylon5:3:~> wtf ..
..: evil grin
real life
significant other

ie. it matches all 2-character acronyms

>How-To-Repeat:
see above

>Fix:
Something along the lines of:

--- wtf.old      Sun Sep  5 22:42:41 1999
+++ wtf Sun Sep 12 23:36:47 1999
@@ -18,8 +18,9 @@
 rv=0
 while [ $# -gt 0 ] ; do
        target=`echo $1 | tr '[a-z]' '[A-Z]'`
-       ans=`sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p" \
-               < $acronyms 2>/dev/null`
+       ans=`egrep -F $target < $acronyms | \
+               sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p" \
+               2>/dev/null`
        if [ "$ans" != "" ] ; then
                echo "$target: $ans"
        else


but I have to admit I'd rather use a fix that wouldn't require the usage of
egrep. (and it doesn't prefectly fix the problem anyhow, but hey, I'm very
tired at the moment ;)

>Audit-Trail:
>Unformatted: