head	1.3;
access;
symbols
	C_3:1.2
	C_2:1.2
	C_1:1.1;
locks; strict;
comment	@# @;


1.3
date	93.04.27.21.38.48;	author roger;	state Exp;
branches;
next	1.2;

1.2
date	90.08.23.22.33.08;	author roger;	state C_3;
branches;
next	1.1;

1.1
date	90.08.23.19.20.07;	author roger;	state C_1;
branches;
next	;


desc
@@


1.3
log
@Handle PATH differences.
@
text
@#!/bin/sh

# $Id: uulog,v 1.2 1990/08/23 22:33:08 roger C_3 roger $
#
#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
#
if [ -d /var ] ; then
	SPOOLROOT=/var
else
	SPOOLROOT=/usr
fi
LOGDIR=${SPOOLROOT}/spool/uucp/.Log
type=uucico
n=""

cd $LOGDIR

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

	-[0-9]*)n=`echo $1|cut -c2-`
		shift
		;;

	-f)	fflag=1
		shift
		if [ $# -eq 0 ]
		then
			echo "System name must follow -f flag" 1>&2
			exit 1
		else
			case "$1" in
			-*)
				echo "System name must follow -f flag" 1>&2
				exit 1
				;;
			esac
		fi
		;;

	-f*)	x=`echo $1|cut -c3-`
		shift
		set - $x $*
		fflag=1
		;;

	-s)	shift
		if [ $# -eq 0 ]
		then
			echo "System name must follow -s flag" 1>&2
			exit 1
		else
			case "$1" in
			-*)
				echo "System name must follow -s flag" 1>&2
				exit 1
				;;
			esac
		fi
		;;

	-s*)	x=`echo $1|cut -c3-`
		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
@


1.2
log
@porting code drop
@
text
@a0 3

# $Id$

d3 2
d18 6
a23 1
LOGDIR=/usr/spool/uucp/.Log
@


1.1
log
@Initial revision
@
text
@d2 1
a2 2
#	Convergent Technologies - System V - Feb 1986
#ident	"@@(#)uulog	6.2 :/source/cmd/uucp/s.uulog 6/17/86 10:18:46"
@
