[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: It's 3am and I have no caffeine



Kevin Mark wrote:
On Wed, Sep 26, 2007 at 03:46:28AM -0400, Chuck Payne wrote:
Guys,

I am sorry to ask such a newbie question, and my eyes are crossed, no caffeine, and I have try everything on the man pages and my serveral books and I am not getting the answer.

Ok. Here are my two question, and two question they yet be.

I need to know the flag for grep to get the exact phrase, for payne.

when I do grep for payne...I like this...

cpayne
cepayne
payne
apayne

I know it got to be simple.

Also, why can I do this zgrep -c, how can I get a count with zgrep.

Again sorry I know these are simple newbie questions, but it late and my brain is aching for CAFFEINE....

Payne

Chuck, there are different options depending what you want.

If you want to grep:
A line that starts with 'payne', this will do it:
egrep "^payne" greptest
If you want to grep a line 'payne' this will do it:
egrep "^payne$"

if you want a sentence that contains the word 'payne' then you need
something different.

cheers,
Kev
Kevin,

Thanks, I got it. I need to use -w, finds only matches for whole line. So thanks on that.

Now I am trying to get count to work with zgrep. When I do zgrep -c, I get a what I am looking for and not a count. Anyway try to play with it to figure before I crash.

Again thanks for the reply.

Payne



Reply to: