MACSCRPT Archives

January 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Philip Aker <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 1 Jan 2007 07:38:34 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
On 2006-12-31, at 08:31:18, Mark Lively wrote:

> On Dec 31, 2006, at 4:45 AM, Olof Svensson wrote:

> What I think you want is

> if grep -v $ip1 $alog | grep -v $ip2

> What you have searches the file and if there is a line that is  
> missing the first ip address it returns true and since || returns  
> true before evaluating all of the parameters you merely get a list  
> from the first.

> | is called the pipe operator and it takes the output of one  
> command and feeds it into the next as an input.  Notice that I  
> didn't have a file in the second grep.

>> and how do I the pipe the result to a new BBEdit-file

/usr/bin/open

If BBEdit is the default text editor:

	grep -v "127.0.0.1" /private/var/log/httpd/access_log | grep -v  
"192.168.0.101" | open -f


If not:

	grep -v "127.0.0.1" /private/var/log/httpd/access_log | grep -v  
"192.168.0.101" | open -a BBEdit -f


If a file is necessary:

	grep -v "127.0.0.1" /private/var/log/httpd/access_log | grep -v  
"192.168.0.101" > bb.txt; open -a BBEdit bb.txt




Philip Aker
[log in to unmask]

ATOM RSS1 RSS2