Grep include but not....

Grep include but not....

am 13.09.2007 18:51:18 von RocketMan

Is there a way to write a grep that will include 'sqlplus' but not
'sqlplus -S'?

Re: Grep include but not....

am 13.09.2007 19:06:54 von Miles

On Sep 13, 11:51 am, RocketMan wrote:
> Is there a way to write a grep that will include 'sqlplus' but not
> 'sqlplus -S'?

The version of grep that I have (AIX) has a -x flag.

so:
grep -x sqlplus

Will do what you want.

Miles

Re: Grep include but not....

am 13.09.2007 20:05:00 von Bill Marcum

On Thu, 13 Sep 2007 09:51:18 -0700, RocketMan
wrote:
>
>
> Is there a way to write a grep that will include 'sqlplus' but not
> 'sqlplus -S'?
>
grep 'sqlplus' | grep -v 'sqlplus -S'
awk '/sqlplus/ && !/sqlplus -S/'

--
QOTD:
"In the shopping mall of the mind, he's in the toy department."

Re: Grep include but not....

am 14.09.2007 11:53:53 von Ivan Gotovchits

RocketMan wrote:

> Is there a way to write a grep that will include 'sqlplus' but not
> 'sqlplus -S'?
or grep '\bsqlplus\b'
--
s/.../.gotovchits/g for email.

Re: Grep include but not....

am 14.09.2007 13:56:31 von hymie_

In our last episode, the evil Dr. Lacto had captured our hero,
ivan...@auriga.ru, crazydm@gmail.com, who said:
>RocketMan wrote:
>
>> Is there a way to write a grep that will include 'sqlplus' but not
>> 'sqlplus -S'?
>or grep '\bsqlplus\b'

Maybe your grep is different from my grep, but '\bsqlplus\b' matches
'sqlplus -S'.

--hymie! http://lactose.homelinux.net/~hymie hymie@lactose.homelinux.net
------------------------ Without caffeine for 318 days ------------------------