The UNIX Forums
"Join the Network of UNIX System Users"


 
kitlindell
Newbie
Rank: 1



UID 224
Digest Posts 0
Credits 0
Posts 50
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 08:23 AM  Profile | P.M. 
grep -e



grep -e




hello all,

i am trying this command:


run something | grep -e [ "test"|"test2"] | cut -f1 -d " "

it is returning on the grep -e saying that it is an illegal operation/command..


i am obviously using this command wrong.

can anyone see the mistake in my syntax?


Top
karan265
Newbie
Rank: 1



UID 214
Digest Posts 0
Credits 0
Posts 78
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 08:23 AM  Profile | P.M. 
lamagra,
see if this works for you:

code:
Top
Drew007
Newbie
Rank: 1



UID 124
Digest Posts 0
Credits 0
Posts 9
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 08:24 AM  Profile | P.M. 
that worked but, i have a little bit of a problem now. i have it cutting left and right for one pattern but it messes up the other pattern.

is there any way to cut for the two different patterns (using the egrep)?


i dont know if you can imbed an if statement.

thanks again for your replies,
Top
Freewebspace
Newbie
Rank: 1



UID 152
Digest Posts 0
Credits 0
Posts 7
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 14, 2007 08:24 AM  Profile | P.M. 
lamagra,
please, give as much information as you think relevant to solve
the problem, such as input file and expected output.
so far, i don't know how the input file looks like.
also, doing a 'grep' for 'test' will also take 'test2'.
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:40 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005623 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP