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]