#!/usr/bin/sh
#
# Usage:
#
# viman [ brick ] manpage_name
#
# where: brick is the section (ie, 1 1m 2 3 4, etc) and the
# manpage name is for a command, fileformat, subsystem, etc
#
# edit a man page through a set of filters that remove backspaces
# (text enhancements) then remove extra blanklines and finally
# run vi on the result. Makes searching for things in the man
# pages a lot easier.
#
TEMPFILE=/usr/tmp/viman.$$
trap "rm -f $TEMPFILE" 0 1 2 3 15
man $* | col -b | ssp | unexpand -a > $TEMPFILE
if [ -s $TEMPFILE ]
then
vi $TEMPFILE
fi
rm -rf $TEMPFILE
#### END OF SCRIPT