Annotation of researchv10dc/630/bin/dmdcat, revision 1.1.1.1

1.1       root        1: #       Copyright (c) 1987 AT&T   
                      2: #       All Rights Reserved       
                      3: 
                      4: #       THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T   
                      5: #       The copyright notice above does not evidence any     
                      6: #       actual or intended publication of such source code.  
                      7: 
                      8: # @(#)dmdcat.sh        1.1.1.5 (6/12/87)
                      9: 
                     10: # dmdcat shell
                     11: #
                     12: 
                     13: pon="1i"
                     14: poff="\033[?4i\r\c"
                     15: pcol=0
                     16: prog=$0
                     17: v=
                     18: u=
                     19: t=
                     20: e=
                     21: 
                     22: #
                     23: # SVR2: use getopt(1)
                     24: # SVR3: use getopts(1)
                     25: #
                     26: 
                     27: #   if [ # getopts exists ]
                     28: #   then
                     29: #      while getopts bsvute c
                     30: #      do
                     31: #              case $c in
                     32: #              b) 
                     33: #                      if [ ! -x /usr/bin/col ]
                     34: #                      then
                     35: #                              echo '${prog}: -b option does not work on your computer'
                     36: #                              exit 1
                     37: #                      else
                     38: #                              pcol=1
                     39: #                      fi
                     40: #                      ;;
                     41: #
                     42: #              s) pon="\033[?5;2i\r"; poff="\033[4i\r\c" ;;
                     43: #              v) v="-v";;
                     44: #              u) u="-u";;
                     45: #              t) t="-t";;
                     46: #              e) e="-e";;
                     47: #              \?) echo "Usage: ${prog} [-b] [-s] [-v] [-u] [-t] [-e] [file ...]"; 
                     48: #                  exit 2;;
                     49: #              esac
                     50: #      done
                     51: #               
                     52: #   else
                     53: 
                     54:        set -- `getopt bsvute $*`
                     55:        if [ $? != 0 ]
                     56:        then
                     57:                echo "Usage: ${prog} [-b] [-s] [-v] [-u] [-t] [-e] [file ...]"
                     58:                exit 2
                     59:        fi
                     60:    
                     61:        while [ true ]
                     62:        do
                     63:                case "$1" in
                     64:                -b) 
                     65:                        if [ ! -x /usr/bin/col ]
                     66:                        then
                     67:                                echo '${prog}: -b option does not work on your computer'
                     68:                                exit 1
                     69:                        else
                     70:                                pcol=1
                     71:                        fi
                     72:                        ;;
                     73: 
                     74:                -s)
                     75:                        pon="2i"
                     76:                        poff="\033[4i\r\c"
                     77:                        ;;
                     78: 
                     79:                -v)
                     80:                        v="-v"
                     81:                        ;;
                     82:                -u)
                     83:                        u="-u"
                     84:                        ;;
                     85:                -t)
                     86:                        t="-t"
                     87:                        ;;
                     88:                -e)
                     89:                        e="-e"
                     90:                        ;;
                     91: 
                     92:                --)
                     93:                        shift; break;;
                     94:                esac
                     95:                shift
                     96:        done
                     97: 
                     98: #   fi
                     99: 
                    100: 
                    101: if [ ! -x $DMD/lib/dmdgetpr ]
                    102: then
                    103:        echo ${prog}:  cannot execute $DMD/lib/dmdgetpr
                    104:        exit 1
                    105: fi
                    106: 
                    107: trap "" 2
                    108: trap 'echo $poff ; exit 1' 2
                    109: if
                    110: #  call c program that reads terminal response and returns
                    111: #  true if printer granted
                    112:        $DMD/lib/dmdgetpr "$pon" </dev/tty
                    113: then
                    114:        echo $poff 
                    115:        echo ${prog}:  printer not available
                    116:        exit 1
                    117: fi
                    118: 
                    119: if [ $pcol = 1 ]
                    120: then
                    121:        cat $v $u $t $e $@ | col -b
                    122: else
                    123:        cat $v $u $t $e $@ 
                    124: fi
                    125: 
                    126: exitstatus=$?
                    127: trap "" 2
                    128: echo $poff 
                    129: exit $exitstatus

unix.superglobalmegacorp.com

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