#! /bin/sh
# Goes through ftp logs summarizing interesting information on a per line
# basis, so conventional Unix tools can deal more easily with it.
# Mark Moraes
PATH=/local/bin:/usr/ucb:/usr/bin:/bin
export PATH
awk '$6 == "connection" {host=$8} 
	$6 == "USER" {user=$7} 
	$6 == "PASS" {if (NF > 6) pass=$7} 
	$6 == "RETR" || $6 == "STOR" || $6 == "MKD" || $6 == "XMKD" || \
	$6 == "RMD" || $6 == "XRMD" || $6 == "DELE" || $6 == "RNTO" || \
	$6 == "RNFR" || $6 == "STOU" || $6 == "APPE" \
		{print host, user, pass, $1, $2, $3, $6, $7}' $*
