mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
Initial revision
git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5099 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
36
wtf/wtf.in
Executable file
36
wtf/wtf.in
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $NetBSD: wtf,v 1.5 1999/08/13 03:02:06 sommerfeld Exp $
|
||||
#
|
||||
# Public domain
|
||||
#
|
||||
|
||||
acronyms=${ACRONYMDB:-@wtf_acronymfile@}
|
||||
|
||||
if [ X"$1" = X"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[[:space:]]/s/^$target[[:space:]]*//p" \
|
||||
< $acronyms 2>/dev/null`
|
||||
if [ "$ans" != "" ] ; then
|
||||
echo "$target: $ans"
|
||||
else
|
||||
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..." 1>&2
|
||||
rv=1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
done
|
||||
exit $rv
|
||||
Reference in New Issue
Block a user