Tailing logs

George Davidovich freebsd at optimis.net
Sat Aug 23 16:11:19 UTC 2008


On Sat, Aug 23, 2008 at 11:07:59AM -0400, Chuck Robey wrote:
> DAve wrote:
> > DAve wrote:
  
> I do this commonly to catch the lines with the  word "Building" in them,
> from a file "build.out:
> 
> tail -F build.out | grep --color=always Building
> 
> When I get a free moment, I need to see about making that --color-always
> the default.

Grep provides for a number of environmental variables, the above being
one of them.  For example:

export GREP_COLOR='0;32'
export GREP_OPTIONS='--color=auto'

Perfectly acceptable for regular use, but especially useful to test
pattern matching before finalising that script you're working on.

-- 
George


More information about the freebsd-questions mailing list