From owner-freebsd-questions Fri Oct 15 10:50:12 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id C692815186 for ; Fri, 15 Oct 1999 10:49:59 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.0.4] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.032 #1) id 11cBDN-00037H-00; Fri, 15 Oct 1999 18:32:25 +0100 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.032 #1) id 11cBDN-000058-00; Fri, 15 Oct 1999 18:32:25 +0100 Date: Fri, 15 Oct 1999 18:32:25 +0100 From: Ben Smithurst To: Dirk Myers Cc: Hugh Blandford , questions@FreeBSD.ORG Subject: Re: Off topic: Scripting gurus please help. Message-ID: <19991015183225.A301@strontium.scientia.demon.co.uk> References: <001c01bf161c$b2a1b260$088ea8c0@island.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dirk Myers wrote: >> 202.34.179.53 - - [29/May/1999:00:10:58 +1000] "GET /profile/Lware.class >> HTTP/1.1" 200 2117 >> >> 203.44.126.127 - - [14/Oct/1999:18:06:47 +1000] "GET /images/logo.jpg >> HTTP/1.0" 304 - "http://www.esprelax.com.au/links/links.html" " >> Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)" > > The standard toolkit is your friend. There's very little reason to script > this. > > Assuming that: > > (a) The file is named my.log > (b) All files of the second format end in a ')' This may not be the case. They all end in a quoted user-agent string. This happens to end with a ")" for Netscape and M$IE. However, all the lines appear to end with a '"' (double quote) for the second format, so I'd modify your commands, > % grep ')$' my.log > secondformat.log > % grep '[^)]$' my.log > firstformat.log to: % grep '"$' my.log > secondformat.log % grep '[^"]$' my.log > firstformat.log -- Ben Smithurst | PGP: 0x99392F7D ben@scientia.demon.co.uk | key available from keyservers and | ben+pgp@scientia.demon.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message