%V 0
%I bb Mon Jun 23 09:03:24 1980
a0
: B flags, D dictionary, F files, H history, S stop, V data for -v
H=${H-/usr/dict/spellhist}
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=${D-/usr/dict/hlistb}
		B="$B -b" ;;
	*)	F="$F $A"
	esac
done
deroff -w $F |\
  sort -u |\
  /usr/lib/spell ${S-/usr/dict/hstop} $T |\
  /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\
  sort -u +0f +0 - $T |\
  tee -a $H
who am i >>$H 2>/dev/null
case $V in
/dev/null)	exit
esac
sed '/^\./d' $V | sort -u +1f +0
.
%E
%I bb Mon Jun 23 09:09:45 1980
%C miscellaneous cleaning up
d2
c6
trap "/bin/rm -f $T*; exit" 0 1 2 13 15
.
c13
	-b)     D=$/usr/dict/hlistb
.
a14
	-*)     echo Spell: unknown option $A
		/bin/rm -f $T*; exit;;
.
c17
	done
.
c20 24
  /usr/lib/spell/spell /usr/dict/hstop $T |\
  /usr/lib/spell/spell ${D-/usr/dict/hlista} $V $B |\
  sort -u +0f +0 - $T
.
%E
%I bb Mon Jun 23 09:10:35 1980
%C send input through fonts preprocessor to remove font change characters
c19
/usr/lib/ss/fonts $F |\
  deroff -w |\
.
%E
%I bb Thu Jun 26 16:30:55 1980
%C added -x option to fonts to remove font change characters
c19
/usr/lib/ss/fonts -x $F |\
.
%E
%I bb Thu Sep 25 08:50:21 1980
%C moved hashed lists into a subdirectory
c12
	-b)     D=/usr/dict/hash/british
.
c22 23
  /usr/lib/spell/spell /usr/dict/hash/stop $T |\
  /usr/lib/spell/spell ${D-/usr/dict/hash/american} $V $B |\
.
%E
%I bb Thu Oct 16 14:17:33 1980
%C complete rework, save derivations, fix pipe bug, etc.
c1 6
PATH=/bin
dic=american
temp=/tmp/spell.$$
files=
bflag=
vflag=
for arg
.
c8 10
	case $arg in
	-v)     vflag=-v ;;
.
c12 16
	-b)     dic=british
		bflag=-b ;;
	-*)     echo spell: unknown option $arg
		exit ;;
	*)      files="$files $arg"
.
c18 28
done
umask 077
trap "rm -f $temp.?; exit" 0 1 2 13 15
/usr/lib/ss/fonts -x $files |\
	deroff -w |\
	sort -u |\
	/usr/lib/spell /usr/dict/hash/stop $temp.1 $bflag |\
	/usr/lib/spell /usr/dict/hash/$dic $temp.v $bflag > $temp.2
sort -u +0f +0 $temp.1 $temp.2
sed '/^\./d' $temp.v | sort -u +1f +0 > $temp.1
if [ "$vflag" = "-v" ]; then
	cat $temp.1 | tee -a /usr/dict/save
else
	cat $temp.1 >>       /usr/dict/save
fi
.
%E
%I bb Fri Oct 24 09:16:37 1980
%C added -d option, mods due to changes in spell.c, cleaned up generally
d1
a5
dflag=
.
c7 8
PATH=/bin
export PATH
for arg do
.
c10
	-d)     dflag=d ;;
	-v)     vflag=v ;;
.
c25 29
	/usr/lib/spell /usr/dict/hash/$dic $temp.d $bflag > $temp.2
if [ "$vflag" = "v" ]; then
	sed '/\+\./d' $temp.d
	sed 's/[	].*//' $temp.1
	cat $temp.2
elif [ "$dflag" = "d" ]; then
	sed '/\+\./d' $temp.d
.
c31 32
	sed 's/[	].*//' $temp.1
	cat $temp.2
fi | sort -u +0df +0
.
%E
%I bb Thu Oct 30 13:49:03 1980
%C cleaned up a bit
c1
prog=/usr/lib/speller
hash=/usr/dict/hash
.
a2
dic=american
.
c26 27
	$prog $hash/stop $temp.1 $bflag |\
	$prog $hash/$dic $temp.d $bflag > $temp.2
.
%E
