#!/bin/csh -f # nutshell - Kevin Inscoe (inscoe@iag.net) 1/7/98 # set variables set mpath = `echo $MANPATH | tr -s ":" " "` set ver = "1.0" # initialize counters @ count_mp = 0 @ count_md = 0 @ count_m = 0 # display our herald echo "nutshell - version" $ver " " `uname -n` " " `uname -s` `uname -r` " " `date` echo " " # display the sections echo "Section 1 - User Commands" echo "Section 1b - SunOS/BSD Compatibility Package Commands" echo "Section 1c - Basic Networking Commands" echo "Section 1f - FMLI Commands" echo "Section 1m - System Administration Commands" echo "Section 1s - SunOS Commands" echo "Section 2 - System Calls" echo "Section 3 - BSD Routines" echo "Section 3b - " echo "Section 3c - C Library Functions" echo "Section 3e - libelf Functions" echo "Section 3g - libgen Functions" echo "Section 3k - " echo "Section 3m - Math Library Functions" echo "Section 3n - Network Services Function" echo "Section 3r - " echo "Section 3s - Standard I/O Functions" echo "Section 3t - " echo "Section 3x - Specialized Libraries" echo "Section 3xc - " echo "Section 3xn - " echo "Section 4 - File Formats" echo "Section 4b - " echo "Section 5 - Miscellaneous" echo "Section 6 - Games" echo "Section 7 - Special Files" echo "Section 7d - " echo "Section 7fs - " echo "Section 7i - " echo "Section 7m - " echo "Section 7p - " echo "Section 8 - System Maintenance Procedures" echo "Section 9 - Solaris Kernel Drivers/Routines" echo "Section 9e - " echo "Section 9f - " echo "Section 9s - " echo "Section l - " echo "Section n - " # find all man pages in MANPATH foreach mp ( $mpath ) @ count_mp = $count_mp + 1 echo "*** manpath:" $mp cd $mp foreach md ( * ) if ( "`file $md | grep directory`" != '' ) then @ count_md = $count_md + 1 foreach m ( $md/* ) @ count_m = $count_m + 1 set sec = "`basename $m | cut -f1 -d.`(`echo $md | tr -d man`)" @ rec = `grep -n ".SH NAME" $m | cut -f1 -d:` + 1 if ( $rec > 1 ) then set t = `head -$rec $m | tail -1` set title = `echo $t | cut -f2 -d-` else set title = "{empty}" endif set avail = "`grep Availability $m | tr -d 'Availability'`" # echo $avail if ( "`echo $avail`" == '' ) then echo $sec "- `echo $title`" else echo $sec "[`echo $avail`] - `echo $title`" endif end endif end end