Annotation of researchv10dc/630/bin/dmdman, revision 1.1

1.1     ! root        1: BASE=/usr/630/man
        !             2: 
        !             3: sec=\?
        !             4: dir=
        !             5: col=
        !             6: cmd=
        !             7: entries=
        !             8: TTERM=
        !             9: 
        !            10: 
        !            11: #  parse options
        !            12: 
        !            13: for i in $*
        !            14: do case $i in
        !            15: 
        !            16:        [1-8])  sec=$i ;;
        !            17:        -c)     col=col ;;
        !            18:        -d)     dir=. ;;
        !            19:        -w)     cmd=w ;;
        !            20:        -T*)    TERM="`echo $i | sed 's/-T//'`" ;;
        !            21:        -12)    TTERM=-12 ;;
        !            22:        *)      entries="$entries $i" ;;
        !            23:    esac
        !            24: done
        !            25: 
        !            26: 
        !            27: #  now find the named entries
        !            28: 
        !            29: for i in $entries
        !            30: do
        !            31:     if [ "$dir" = "." ]
        !            32: 
        !            33:        then if [ ! -r "$i" ]
        !            34: 
        !            35:                then  echo $0: $i not found >&2
        !            36:                      exit 1
        !            37: 
        !            38:                else  all="$all $i"
        !            39: 
        !            40:             fi
        !            41: 
        !            42:        else
        !            43:             cd $BASE
        !            44:             fil="`find */man$sec/$i.* -print 2>/dev/null`"
        !            45: 
        !            46:             # DMD note change for sgs directory if this is later eliminated
        !            47:             if [ ! "$fil" ]
        !            48:             then
        !            49:                     fil="`find sgs/$i.out -print 2>/dev/null`"
        !            50:             fi
        !            51:             # end of change
        !            52: 
        !            53:             if [ -n "$fil" ]
        !            54: 
        !            55:                then  all="$all $fil"
        !            56:                else  echo $0: $i not found >&2
        !            57:                      exit 1
        !            58: 
        !            59:             fi
        !            60:     fi
        !            61: done
        !            62: 
        !            63: 
        !            64: # fix up the terminal type option (make sure to use col, etc.)
        !            65: 
        !            66: case "$TERM$TTERM" in
        !            67: 
        !            68:        300|300s|450|37|300-12|300s-12|450-12| \
        !            69:                4000a|4000A|382|1620|1620-12)   post="greek -T$TERM$TTERM" ;;
        !            70:        hp|2621|2645|2640)      col=col; post="greek -T$TERM$TTERM" ;;
        !            71:        4014|tek)       post="greek -T$TERM$TTERM" ;;
        !            72:        X97)            col=col; post=xerox ;;
        !            73:        *)              col=col; post=cat ;;
        !            74: esac
        !            75: 
        !            76: if [ "$col" != "" ]
        !            77:    then post="$col | $post"
        !            78: fi
        !            79: 
        !            80: 
        !            81: # now print the pages
        !            82: 
        !            83: if [ "$cmd" = "w" ]
        !            84: 
        !            85:    then        echo $all
        !            86:        exit 0
        !            87: 
        !            88:    else        for i in $all
        !            89: 
        !            90:        do case $i in
        !            91: 
        !            92:                *.z)    eval "pcat $i | $post" ;;
        !            93:                *)      eval "cat $i | $post" ;;
        !            94: 
        !            95:           esac
        !            96:        done
        !            97: 
        !            98: fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.