Source-Changes-HG archive

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

[src/trunk]: src/games/wtf Check whatis(1) if we don't find an acronym matchi...



details:   https://anonhg.NetBSD.org/src/rev/d6af88609717
branches:  trunk
changeset: 474903:d6af88609717
user:      briggs <briggs%NetBSD.org@localhost>
date:      Sun Jul 25 20:29:04 1999 +0000

description:
Check whatis(1) if we don't find an acronym matching the argument

diffstat:

 games/wtf/wtf   |  11 ++++++++---
 games/wtf/wtf.6 |  10 ++++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 7155638fa6e4 -r d6af88609717 games/wtf/wtf
--- a/games/wtf/wtf     Sun Jul 25 20:02:48 1999 +0000
+++ b/games/wtf/wtf     Sun Jul 25 20:29:04 1999 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $NetBSD: wtf,v 1.2 1999/07/22 10:08:17 lukem Exp $
+#      $NetBSD: wtf,v 1.3 1999/07/25 20:29:04 briggs Exp $
 #
 # Public domain
 #
@@ -22,8 +22,13 @@
        if [ "$ans" != "" ] ; then
                echo "$target: $ans"
        else
-               echo "Gee...  I don't know what $1 means..."
-               rv=1
+               ans=`whatis $1 2> /dev/null | egrep "^$1[, ]" 2> /dev/null`
+               if [ $? -eq 0 ] ; then
+                       echo "$1: $ans"
+               else
+                       echo "Gee...  I don't know what $1 means..."
+                       rv=1
+               fi
        fi
        shift
 done
diff -r 7155638fa6e4 -r d6af88609717 games/wtf/wtf.6
--- a/games/wtf/wtf.6   Sun Jul 25 20:02:48 1999 +0000
+++ b/games/wtf/wtf.6   Sun Jul 25 20:29:04 1999 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: wtf.6,v 1.2 1999/07/25 20:02:48 thorpej Exp $
+.\"    $NetBSD: wtf.6,v 1.3 1999/07/25 20:29:04 briggs Exp $
 .\"
 .\" Public Domain
 .\"
@@ -16,7 +16,11 @@
 The
 .Nm
 utility displays the expansion of the acronyms 
-specified on the command line.
+specified on the command line.  If the acronym is unknown,
+.Nm
+will check to see if the acronym is known by the
+.Xr whatis 1
+command.
 .Pp
 If
 .Dq is
@@ -37,6 +41,8 @@
 .It Pa /usr/share/misc/acronyms
 default acronym database.
 .El
+.Sh SEE ALSO
+.Xr whatis 1
 .Sh HISTORY
 .Nm
 first appeared in



Home | Main Index | Thread Index | Old Index