
# print documentation for S functions
cd $SHOME/s
case $1 in
"")	echo "S HELP function ..."; exit 1;
esac
trap 'rm -f /tmp/hlp[12]$$' 0 1 2 15
cd .help
ls $* 2>/tmp/hlp1$$ >/tmp/hlp2$$
cd ..
if test "(" ! -s /tmp/hlp2$$ ")" -o -s /tmp/hlp1$$
then
	echo $* | sed 's/ /|/g
	s/^/[ 	](/
	s/$/)$/' >/tmp/hlp1$$
	egrep -f /tmp/hlp1$$ .help/fun.tab |
		sed "s/[ 	].*//" |
		sort -u >>/tmp/hlp2$$
fi
if test ! -s /tmp/hlp2$$; then echo Documentation for $* not found; exit 1; fi
$SHOME/cmd/PRINTDOC -f `cat /tmp/hlp2$$`
