[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using grep (or some other tool) to highlight, instead of grepping?
From: |
Ralf Wildenhues |
Subject: |
Re: Using grep (or some other tool) to highlight, instead of grepping? |
Date: |
Fri, 15 Aug 2008 05:48:23 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Richard,
* Richard Hartmann wrote on Tue, Aug 12, 2008 at 09:11:56PM CEST:
>
> grep --color=auto
>
> I was wondering if there is a tool that will allow me to simply
> highlight whatever I am looking for without actually grepping.
I guess if you translate your basic regex into an extended one, then you
should be able to use egrep/grep -E, and also match end-of-line:
grep -E --color=auto 'foo|$'
Hmm. Using ^ instead of $ destroys the coloring, that looks like a bug
(Debian package grep-2.5.1.ds2-6).
Other than that, editors can typically highlight search matches:
vim -c 'set hls | /foo' FILE
Hope that helps.
Cheers,
Ralf