summaryrefslogtreecommitdiffstats
path: root/share/man/tools/pgcnt
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-05-30 19:09:18 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-05-30 19:09:18 +0000
commitb0d61785cae024b1f44119446a940ee14c9ac959 (patch)
tree5a495a583b002ae9e57f09848ae697160708c220 /share/man/tools/pgcnt
parentd43599f73ba5858e573c7ad8b284f6a0808c5c93 (diff)
downloadFreeBSD-src-b0d61785cae024b1f44119446a940ee14c9ac959.zip
FreeBSD-src-b0d61785cae024b1f44119446a940ee14c9ac959.tar.gz
BSD 4.4 Lite Share Sources
Diffstat (limited to 'share/man/tools/pgcnt')
-rwxr-xr-xshare/man/tools/pgcnt92
1 files changed, 92 insertions, 0 deletions
diff --git a/share/man/tools/pgcnt b/share/man/tools/pgcnt
new file mode 100755
index 0000000..6a7d4f0
--- /dev/null
+++ b/share/man/tools/pgcnt
@@ -0,0 +1,92 @@
+set x $*
+. ./.param
+
+PATH=$PATH:$MANDIR/tools
+
+sm=
+if test "$PFLAG" -eq 1
+then
+ sm="-rs1"
+fi
+
+for dir in $DIRLST
+do
+ cd $MANDIR/man$dir
+ date > $TMPDIR/pages$dir
+ echo >> $TMPDIR/pages$dir
+ for file in $FILLST
+ do
+ prep="cat $file |"
+
+ first=`line < $file`
+ case "$first" in
+ .so*) continue
+ ;;
+ \'\\\"*)
+ option=`expr "$first" : '.* \(.*\)'`
+ case "$option" in
+ c)
+ prep="${prep} cw |"
+ ;;
+ e)
+ prep="${prep} eqn |"
+ ;;
+ t)
+ prep="${prep} tbl |"
+ ;;
+ ce | ec)
+ prep="${prep} cw | eqn"
+ ;;
+ ct | tc)
+ prep="${prep} cw | tbl |"
+ ;;
+ et | te)
+ prep="${prep} tbl | eqn |"
+ ;;
+ cet | cte | ect | etc | tce | tec)
+ prep="${prep} cw | tbl | eqn |"
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+
+ numb=`eval ${prep} troff -man $sm -s -f -t | pages`
+ echo "$file $numb" >> $TMPDIR/pages$dir
+ done
+done
+
+tsum=0
+cd $TMPDIR
+date > totalpgs
+echo >> totalpgs
+
+for dir in $DIRLST
+do
+ ed - pages$dir <<!
+ 1,2d
+ w tmp1.$$
+ q
+!
+ sum=0
+ while read val
+ do
+ val=`echo $val | sed "s/.* / /"`
+ sum=`expr $sum + $val`
+ if test $? -eq 2
+ then
+ echo "pgcnt: error in summing - sum is $sum, val is $val"
+ exit
+ fi
+ echo $sum > tmp.$$
+ done < tmp1.$$
+ sumt=`line < tmp.$$`
+ echo "total pages Section $dir -- $sumt" >> totalpgs
+ tsum=`expr $tsum + $sumt`
+done
+
+echo >> totalpgs
+echo >> totalpgs
+echo "total pages -- $tsum" >> totalpgs
+rm tmp.$$ tmp1.$$
OpenPOWER on IntegriCloud