#!/bin/sh set -x ################################################################################ #ident "@(#) view info pages with editor. (John S. Urban, 019910321)" # vi an info page if you are familiar with the vi editor. # # more(1) and/or pg(1) are nice for beginners # but more often than not it is much nicer to # vi(1) the info page if you are familiar with the # vi(1) editor. # ################################################################################ SCRATCH=/tmp/man.$$ trap "rm $SCRATCH; exit 2" 1 2 3 15 export SCRATCH ################################################################################ if ( test $# -eq 0 ) then # case "`uname -s`" in *CYGWIN*)man -k \(|col -b > $SCRATCH;; *)man -k ' ' > $SCRATCH;; *)man -k '.' > $SCRATCH;; *)man -k '\('|col -b > $SCRATCH;; esac else machine=`uname -s` case "${machine}" in #========================================================================= *) info --where $* info -o $SCRATCH --subnodes $* # --subnodes recursively output menu items. # -w, --where, --location print physical location of Info file. ;; #========================================================================= ULTRIX) ;; #========================================================================= sn[0-9]*|UNICOS) ;; #========================================================================= SunOS) ;; #========================================================================= HP-UX) ;; #========================================================================= esac fi ################################################################################ # some word counts use different orders COUNT=`wc -l "$SCRATCH"|awk '{print $1}'` COUNT=${COUNT:-0} [ ! -z "$SCRATCH" -a "$COUNT" -gt 1 ] && ${EDIT:-vi} $SCRATCH rm -rf $SCRATCH ################################################################################ exit ################################################################################