summaryrefslogtreecommitdiffstats
path: root/wtf
diff options
context:
space:
mode:
authorbriggs <briggs@NetBSD.org>1999-07-25 20:29:04 +0000
committerbriggs <briggs@NetBSD.org>1999-07-25 20:29:04 +0000
commit02a9c5ad2769cffcd3a98c3cbfe896960d0e9fc3 (patch)
treebfff7c6a5a21566a141ea91b731b6d60b89e158a /wtf
parent3f86d1a12fcc06ac83807c269fbc573393f8cf40 (diff)
downloadbsdgames-darwin-02a9c5ad2769cffcd3a98c3cbfe896960d0e9fc3.tar.gz
bsdgames-darwin-02a9c5ad2769cffcd3a98c3cbfe896960d0e9fc3.tar.zst
bsdgames-darwin-02a9c5ad2769cffcd3a98c3cbfe896960d0e9fc3.zip
Check whatis(1) if we don't find an acronym matching the argument
Diffstat (limited to 'wtf')
-rw-r--r--wtf/wtf11
-rw-r--r--wtf/wtf.610
2 files changed, 16 insertions, 5 deletions
diff --git a/wtf/wtf b/wtf/wtf
index 23ce887d..f810817a 100644
--- a/wtf/wtf
+++ b/wtf/wtf
@@ -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 @@ while [ $# -gt 0 ] ; do
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 --git a/wtf/wtf.6 b/wtf/wtf.6
index a33c3aee..e44cc348 100644
--- a/wtf/wtf.6
+++ b/wtf/wtf.6
@@ -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 @@ to the name of a file in the proper format (acronym[tab]meaning).
.It Pa /usr/share/misc/acronyms
default acronym database.
.El
+.Sh SEE ALSO
+.Xr whatis 1
.Sh HISTORY
.Nm
first appeared in