Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/wtf make sure only whole words are matched, use [:spac...



details:   https://anonhg.NetBSD.org/src/rev/829f2d0832bf
branches:  trunk
changeset: 474950:829f2d0832bf
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Jul 27 15:41:27 1999 +0000

description:
make sure only whole words are matched, use [:space:] RE to avoid embedded
<TAB>s

diffstat:

 games/wtf/wtf |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 192461b3d179 -r 829f2d0832bf games/wtf/wtf
--- a/games/wtf/wtf     Tue Jul 27 12:13:19 1999 +0000
+++ b/games/wtf/wtf     Tue Jul 27 15:41:27 1999 +0000
@@ -1,6 +1,6 @@
 #!/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
 #
@@ -18,7 +18,8 @@
 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



Home | Main Index | Thread Index | Old Index