Annotation of researchv10no/cmd/uucp/uulog, revision 1.1.1.1

1.1       root        1: 
                      2: #! /bin/sh
                      3: #From: ulysses!smb (Steven Bellovin)
                      4: #
                      5: # usage:
                      6: #      uulog
                      7: # or   uulog foo
                      8: # or   uulog -sfoo
                      9: # or   uulog -s foo
                     10: # or   uulog -ffoo
                     11: # or   uulog -f foo
                     12: #
                     13: #      -x means check the execute file
                     14: #      -nnn where 'nnn' is a number will do tail -nnn
                     15: #
                     16: LOGDIR=/usr/spool/uucp/.Log
                     17: type=uucico
                     18: n=""
                     19: 
                     20: cd $LOGDIR
                     21: 
                     22: while [ $# -gt 0 ]
                     23: do
                     24:        case $1 in
                     25:        -x)     type=uuxqt
                     26:                shift
                     27:                ;;
                     28: 
                     29:        -[0-9]*)n=`expr $1 : '.\(.*\)'`
                     30:                shift
                     31:                ;;
                     32: 
                     33:        -f)     fflag=1
                     34:                shift
                     35:                ;;
                     36: 
                     37:        -f*)    x=`expr $1 : '..\(.*\)'`
                     38:                shift
                     39:                set - $x $*
                     40:                fflag=1
                     41:                ;;
                     42: 
                     43:        -s)     shift
                     44:                ;;
                     45: 
                     46:        -s*)    x=`expr $1 : '..\(.*\)'`
                     47:                shift
                     48:                set - $x $*
                     49:                ;;
                     50: 
                     51:        -*)     echo "Invalid flag $1" 1>&2
                     52:                exit 1
                     53:                ;;
                     54: 
                     55:        *)      sys="$sys $1"
                     56:                shift
                     57:                ;;
                     58: 
                     59:        esac
                     60: done
                     61: 
                     62: set - $sys
                     63: if [ x$fflag = x ]; then
                     64:        if [ $# = 0 ]; then
                     65:                set - `ls $type`
                     66:        fi
                     67:        for i
                     68:        do
                     69:                if [ x$n = x ]; then
                     70:                        cat $type/$i
                     71:                else
                     72:                        tail -$n $type/$i
                     73:                fi
                     74:        done
                     75: else
                     76:        if [ $# != 1 ]; then
                     77:                echo "Exactly one system with -f" 1>&2
                     78:                exit 2
                     79:        fi
                     80:        exec tail -${n}f $type/$1
                     81: fi

unix.superglobalmegacorp.com

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