The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grep help flood Shell Programming and Scripting 3 06-06-2008 02:14 AM
Grep Aejaz UNIX for Advanced & Expert Users 3 04-30-2008 08:10 AM
grep dineshr85 Shell Programming and Scripting 1 10-10-2007 05:52 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-05-2007 03:59 AM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-25-2006 01:20 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-10-2005
malaymaru malaymaru is offline
Registered User
  
 

Join Date: May 2005
Posts: 54
grep help

Hi,

What is the command to find out more than 1 patterns from any file?

Thanks in advance.

Malay Maru
  #2 (permalink)  
Old 05-10-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
try


grep -e "pattern1|pattern2" file1

or


egrep "pattern1|pattern2" file1
  #3 (permalink)  
Old 05-10-2005
malaymaru malaymaru is offline
Registered User
  
 

Join Date: May 2005
Posts: 54
Hi,

second one is working fine but not first one.

$ grep -e "HSBC|malay" temp.txt
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .

Can you tell me y? I am using solaris 5.9 OS.

Malay
  #4 (permalink)  
Old 05-10-2005
reborg's Avatar
reborg reborg is online now Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,235
use bhargv's second suggestion ie. egrep and it will work fine.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0