Added Christoph Robitschko's catman
authorJordan K. Hubbard <jkh@FreeBSD.org>
Fri, 23 Jul 1993 02:36:24 +0000 (02:36 +0000)
committerJordan K. Hubbard <jkh@FreeBSD.org>
Fri, 23 Jul 1993 02:36:24 +0000 (02:36 +0000)
gnu/usr.bin/man/Makefile
gnu/usr.bin/man/catman/Makefile [new file with mode: 0644]
gnu/usr.bin/man/catman/catman [new file with mode: 0644]

index 1777b66..0e7e506 100644 (file)
@@ -5,6 +5,6 @@
 # distribution.  
 #
 
 # distribution.  
 #
 
-SUBDIR = lib man manpath apropos whatis makewhatis
+SUBDIR = lib man manpath apropos whatis makewhatis catman
 
 .include <bsd.subdir.mk>
 
 .include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/man/catman/Makefile b/gnu/usr.bin/man/catman/Makefile
new file mode 100644 (file)
index 0000000..8cb35e5
--- /dev/null
@@ -0,0 +1,7 @@
+obj cleandir clean depend rcsfreeze tags all:
+       @echo -n
+
+install:
+       install -c -o bin -g bin -m 555 catman /usr/bin
+
+.include "../Makefile.inc"
diff --git a/gnu/usr.bin/man/catman/catman b/gnu/usr.bin/man/catman/catman
new file mode 100644 (file)
index 0000000..a2d16a1
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+# usage: sh catman
+# put the section numbers here:
+SECTIONS="1 2 3 4 5 6 7 8"
+MANDIR=/usr/share/man
+
+formatman()
+{
+       echo "  "$1 "->" $*
+       (cd cat$section; rm -f $*)
+       nroff -man < man$section/$1 > cat$section/$1
+       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