]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
make sure only whole words are matched, use [:space:] RE to avoid embedded
authordrochner <drochner@NetBSD.org>
Tue, 27 Jul 1999 15:41:27 +0000 (15:41 +0000)
committerdrochner <drochner@NetBSD.org>
Tue, 27 Jul 1999 15:41:27 +0000 (15:41 +0000)
<TAB>s

wtf/wtf

diff --git a/wtf/wtf b/wtf/wtf
index f810817a2df78c6c55f6136a43e6ef54a0e56494..c4a0d893c5677751fb6181ee3dd29c30941b3543 100644 (file)
--- a/wtf/wtf
+++ b/wtf/wtf
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
 #!/bin/sh
 #
-#      $NetBSD: wtf,v 1.3 1999/07/25 20:29:04 briggs Exp $
+#      $NetBSD: wtf,v 1.4 1999/07/27 15:41:27 drochner Exp $
 #
 # Public domain
 #
 #
 # Public domain
 #
@@ -18,7 +18,8 @@ fi
 rv=0
 while [ $# -gt 0 ] ; do
        target=`echo $1 | tr '[a-z]' '[A-Z]'`
 rv=0
 while [ $# -gt 0 ] ; do
        target=`echo $1 | tr '[a-z]' '[A-Z]'`
-       ans=`sed -ne "/^$target/s/^$target[     ]*//p" < $acronyms 2>/dev/null`
+       ans=`sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p" \
+               < $acronyms 2>/dev/null`
        if [ "$ans" != "" ] ; then
                echo "$target: $ans"
        else
        if [ "$ans" != "" ] ; then
                echo "$target: $ans"
        else