summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-03-23 18:50:57 +0000
committerjkh <jkh@FreeBSD.org>1994-03-23 18:50:57 +0000
commitd377492fa0f3c359340d7e0d573999e302dcf192 (patch)
treec0a5751f88537c629b14c6cd37f7572accf82805 /gnu/usr.bin
parent9951f4331e0349dcfc45c0b316155c3a616454f2 (diff)
downloadFreeBSD-src-d377492fa0f3c359340d7e0d573999e302dcf192.zip
FreeBSD-src-d377492fa0f3c359340d7e0d573999e302dcf192.tar.gz
Something bogus happened here; not sure what or how.
Fixed.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/man/catman/catman.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/usr.bin/man/catman/catman.sh b/gnu/usr.bin/man/catman/catman.sh
new file mode 100644
index 0000000..e5d23e1
--- /dev/null
+++ b/gnu/usr.bin/man/catman/catman.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# usage: sh catman
+# put the section numbers here:
+SECTIONS="1 2 3 4 5 6 7 8"
+MANDIR=/usr/share/man
+
+formatman()
+{
+ suffix=`echo $1 | sed -e 's/.*\\.//'`
+ echo " "$1 "->" $*
+ (cd cat$section; rm -f $*)
+ if [ ".$suffix" = "%compext%" ]; then
+ %zcat% man$section/$1 | nroff -man | %compress% > cat$section/$1
+ else
+ nroff -man < man$section/$1 > cat$section/$1
+ fi
+ catfile=$1; shift
+ while [ $# -gt 0 ]
+ do
+ ln cat$section/$catfile cat$section/$1
+ shift
+ done
+}
+
+cd $MANDIR
+for section in $SECTIONS
+do
+ echo formatting section $section ...
+
+ IFS=" "
+ allfiles=`ls -i1 man$section | sort | awk '{if (inode ~ $1) printf "/" $2;
+ else printf " " $2; inode = $1 } END {printf "\n"}'`
+ for files in $allfiles
+ do
+ IFS="/"
+ tfiles=`echo $files`
+ IFS=" "
+ formatman $tfiles
+ done
+done
+exit 0
OpenPOWER on IntegriCloud