X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Subject: Quick script for formatting man pages To: djgpp-workers AT delorie DOT com X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006 Message-ID: From: Gordon DOT Schumacher AT seagate DOT com Date: Mon, 19 Mar 2007 17:21:14 -0600 X-MIMETrack: Serialize by Router on SV-GW1/Seagate Internet(Release 7.0.1 HF29|March 07, 2006) at 03/19/2007 04:21:32 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Proofpoint-FWRule: outbound2 X-Proofpoint-Virus-Version: vendor=fsecure engine=4.65.5502:2.3.11,1.2.37,4.0.164 definitions=2007-03-19_05:2007-03-19,2007-03-19,2007-03-19 signatures=0 Reply-To: djgpp-workers AT delorie DOT com Perhaps this will make someone's life a little easier when porting packages... I wrote a script to invoke "man" on each entry in a man directory, in order to format all the pages: #!/bin/sh # Make sure they gave us an arg if [ $# -lt 1 ]; then echo "Usage: `basename $0` [mandirs...]" exit 255 fi while [ $# -ge 1 ]; do if [ ! -d $1 ]; then echo "$1: arguments should be 'man' directories" else dir=`cd $1; pwd` filelist=`find $dir/man? -type f` for file in $filelist; do entry=`basename $file` outdir=`dirname $file` outdir=`echo $outdir |sed 's/man\(.\)$/cat\1/'` mkdir -p $outdir echo "Formatting entry for $entry..." groff -T ascii -m man $file >$outdir/$entry done fi shift done