File:  [Research Unix] / researchv10no / cmd / uucp / uulog
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman


#! /bin/sh
#From: ulysses!smb (Steven Bellovin)
#
# usage:
# 	uulog
# or	uulog foo
# or	uulog -sfoo
# or	uulog -s foo
# or	uulog -ffoo
# or	uulog -f foo
#
#	-x means check the execute file
#	-nnn where 'nnn' is a number will do tail -nnn
#
LOGDIR=/usr/spool/uucp/.Log
type=uucico
n=""

cd $LOGDIR

while [ $# -gt 0 ]
do
	case $1 in
	-x)	type=uuxqt
		shift
		;;

	-[0-9]*)n=`expr $1 : '.\(.*\)'`
		shift
		;;

	-f)	fflag=1
		shift
		;;

	-f*)	x=`expr $1 : '..\(.*\)'`
		shift
		set - $x $*
		fflag=1
		;;

	-s)	shift
		;;

	-s*)	x=`expr $1 : '..\(.*\)'`
		shift
		set - $x $*
		;;

	-*)	echo "Invalid flag $1" 1>&2
		exit 1
		;;

	*)	sys="$sys $1"
		shift
		;;

	esac
done

set - $sys
if [ x$fflag = x ]; then
	if [ $# = 0 ]; then
		set - `ls $type`
	fi
	for i
	do
		if [ x$n = x ]; then
			cat $type/$i
		else
			tail -$n $type/$i
		fi
	done
else
	if [ $# != 1 ]; then
		echo "Exactly one system with -f" 1>&2
		exit 2
	fi
	exec tail -${n}f $type/$1
fi

unix.superglobalmegacorp.com

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