Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2008 08:38:15 -0700
From:      George Davidovich <freebsd@optimis.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Tailing logs
Message-ID:  <20080823153815.GA7395@marvin.optimis.net>
In-Reply-To: <48B027CF.6040605@telenix.org>
References:  <48AECD11.1000705@pixelhammer.com> <48AF048A.1070401@pixelhammer.com> <48B027CF.6040605@telenix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080823153815.GA7395>