:   bm# 0000001657
:   typ S
:   ver generic
:   mod generic
:  
#     SCCSID(@(#)spell.sh	1.1);


:
#
#	@(#) spell.sh 1.1 84/10/08 
#
#	Copyright (C) Microsoft Corporation, 1983
#
#	This Module contains Proprietary Information of Microsoft
#	Corporation and AT&T, and should be treated as Confidential.
#
###	spell
#
#	spell [ -vbx ] [ file ... ]
#
#	MODIFICATION HISTORY
#	M000	22 Sep 83	barrys
#	Commented out the portion of code that would log misspelled words
#	and the users name to the history file
#
# SCCS: @(#)spell.sh	1.6
# B flags, D_SPELL dictionary, F files, H_SPELL history, S_SPELL stop, V data for -v
# H_SPELL=${H_SPELL-/usr/lib/spell/spellhist}		*** M000 ***
T=/tmp/spell.$$
V=/dev/null
F= B=
trap "rm -f $T*; exit" 0 1 2 13 15
for A in $*
do
	case $A in
	-v)	B="$B -v"
		V=${T}a ;;
	-a)	: ;;
	-b) 	D_SPELL=${D_SPELL-/usr/lib/spell/hlistb}
		B="$B -b" ;;
	-x)	B="$B -x" ;;
	*)	F="$F $A"
	esac
	done
deroff -w $F |\
  sort -u |\
  /usr/lib/spell/spellprog ${S_SPELL-/usr/lib/spell/hstop} $T |\
  /usr/lib/spell/spellprog ${D_SPELL-/usr/lib/spell/hlista} $V $B |\
  sort -u +0f +0 - $T 
#  sort -u +0f +0 - $T |\			*** M000 ***
#  tee -a $H_SPELL				*** M000 ***
# who am i >>$H_SPELL 2>/dev/null		*** M000 ***
case $V in
/dev/null)	exit
esac
sed '/^\./d' $V | sort -u +1f +0
