#!/bin/sh trap 'echo ; echo Aborted. ;echo You have to finish. Maybe some formatted pages are incomplete! ; exit' 1 2 3 13 15 DEMETER=$1 echo "Handling man pages for system $DEMETER" case $2 in -y) echo "Formatting ..." echo "Writing into $DEMETER/man/fmt ..." mkdir -p $DEMETER/man/fmt for rawfile in $DEMETER/man/man*/* do if [ -f $rawfile ] ; then groff -man -Tps $rawfile > $DEMETER/man/fmt/`basename $rawfile`.ps fi done echo "Cleaning ..." rm -f *~ echo echo "Printing to renoir..." for fmtfile in $DEMETER/man/fmt/* do echo " $fmtfile" print -Prenoir -h $fmtfile done exit 0 ;; -f) echo "Formatting ..." echo "Writing into $DEMETER/man/fmt ..." mkdir -p $DEMETER/man/fmt for rawfile in $DEMETER/man/man*/* do if [ -f $rawfile ] ; then groff -man -Tps $rawfile > $DEMETER/man/fmt/`basename $rawfile`.ps fi done echo "Cleaning ..." rm -f *~ exit 0 ;; -n) echo echo Looking into $DEMETER/man/fmt ... rm -f *~ echo "Printing to renoir ..." for fmtfile in $DEMETER/man/fmt/* do echo " $fmtfile" print -Prenoir -h $fmtfile done exit 0 ;; esac echo Usage: `basename $0` -n \(print without formatting\) or `basename $0` -y \(format before print\) `basename $0` -f \(only format\)