#!/bin/bash
# pman
# pfman (link)
cd /home/douillet/docs/man/
tmp1=tmp_tmp1
tmp2=tmp_tmp2
dest0=tmp_man.ps
dest=man_$1$2.ps
man $1 $2 > $tmp1
case $1 in
gv) spec=7 ;;
*) sed -n -e "/Berkeley Distribution/p" $tmp1 > $tmp2
sed -n -e "/System Manager's Manual/p" $tmp1 >> $tmp2
sed -n -e "/X Version 11/p" $tmp1 >> $tmp2
sed -n -e "/PLP system/p" $tmp1 >> $tmp2
sed -n -e "/BSD Experimental/p" $tmp1 >> $tmp2
if test -s $tmp2
then spec=7
else spec=8
fi ;;
esac
enscript -mA4 -2rB -i8 -l -fCourier@$spec/7 -o $dest0 $tmp1
sed -e "s¶%%Orientation: Landscape¶%%Orientation: Portrait¶" $dest0 > $dest
chmod a+w $dest
rm tmp*
gv -landscape $dest