diff options
author | mrg <mrg@NetBSD.org> | 1999-07-22 01:03:20 +0000 |
---|---|---|
committer | mrg <mrg@NetBSD.org> | 1999-07-22 01:03:20 +0000 |
commit | bd4f151d9f08addd0ba57925f2570c22f32dad2d (patch) | |
tree | 6d56fb9d036abccf3a98c051a4ab12c2a60289dd /wtf | |
parent | d91aeebe629b8428e564df33c93bb69195d28cc3 (diff) | |
download | bsdgames-darwin-bd4f151d9f08addd0ba57925f2570c22f32dad2d.tar.gz bsdgames-darwin-bd4f151d9f08addd0ba57925f2570c22f32dad2d.tar.zst bsdgames-darwin-bd4f151d9f08addd0ba57925f2570c22f32dad2d.zip |
Allen Briggs' wtf(6) to grovel the acronyms database.
Diffstat (limited to 'wtf')
-rw-r--r-- | wtf/Makefile | 7 | ||||
-rw-r--r-- | wtf/wtf | 30 | ||||
-rw-r--r-- | wtf/wtf.6 | 43 |
3 files changed, 80 insertions, 0 deletions
diff --git a/wtf/Makefile b/wtf/Makefile new file mode 100644 index 00000000..fd0c94bd --- /dev/null +++ b/wtf/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 1999/07/22 01:03:20 mrg Exp $ + +SCRIPTS= wtf +SCRIPTSDIR= /usr/games +MAN= wtf.6 + +.include <bsd.prog.mk> diff --git a/wtf/wtf b/wtf/wtf new file mode 100644 index 00000000..32a5b69e --- /dev/null +++ b/wtf/wtf @@ -0,0 +1,30 @@ +#!/bin/sh +# +# $NetBSD: wtf,v 1.1 1999/07/22 01:03:20 mrg Exp $ +# +# Public domain +# + +acronyms=${ACRONYMDB:-/usr/share/misc/acronyms} + +if [ $1 = "is" ] ; then + shift +fi + +if [ $# -lt 1 ] ; then + echo "Usage: $0 [is] <acronym>" +fi + +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` + if [ "$ans" != "" ] ; then + echo "$target: $ans" + else + echo "Gee... I don't know what $1 means..." + rv=1 + fi + shift +done +exit $rv diff --git a/wtf/wtf.6 b/wtf/wtf.6 new file mode 100644 index 00000000..9658f7ef --- /dev/null +++ b/wtf/wtf.6 @@ -0,0 +1,43 @@ +.\" $NetBSD: wtf.6,v 1.1 1999/07/22 01:03:21 mrg Exp $ +.\" +.\" Public Domain +.\" +.Dd July 21, 1999 +.Dt WTF 1 +.Os +.Sh NAME +.Nm wtf +.Nd translates acronyms for you +.Sh SYNOPSIS +.Nm +.Op Ar is +.Ar acronym Ar ... +.Sh DESCRIPTION +The +.Nm +utility displays the expansion of the acronyms +specified on the command line. +.Pp +If +.Dq is +is specified on the command line, it will be ignored, allowing the +fairly natural +.Dq wtf is WTF +usage. +.Sh ENVIRONMENT +.Bl -tag -width ACRONYMDB +.It Ev ACRONYMDB +The default acronym database may be overridden by setting the +environment variable +.Ev ACRONYMDB +to the name of a file in the proper format (acronym[tab]meaning). +.El +.Sh FILES +.Bl -tag -width /usr/share/misc/acronyms -compact +.It Pa /usr/share/misc/acronyms +default acronym database. +.El +.Sh HISTORY +.Nm +first appeared in +.Nx 1.5 . |