Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Search Forums:



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-01-2009
Tirmazi's Avatar
Registered User
 

Join Date: Apr 2008
Location: Maryland, USA
Posts: 81
Thanks: 26
Thanked 1 Time in 1 Post
grep question

Instead of using the following command
#dmesg | grep -v sendmail | grep -v xntpd

How can I use just one grep -v and give both arguments.

Please suggest

thanks
Sponsored Links
    #2  
Old 06-01-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 8,511
Thanks: 67
Thanked 403 Times in 392 Posts

Code:
#dmesg | grep -v -e sendmail -e xntpd

Sponsored Links
    #3  
Old 06-02-2009
Tirmazi's Avatar
Registered User
 

Join Date: Apr 2008
Location: Maryland, USA
Posts: 81
Thanks: 26
Thanked 1 Time in 1 Post
that i am sorry did not work on solaris 8

# dmesg | grep -v -e sendmail -e xntpd
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .
Broken Pipe
    #4  
Old 06-02-2009
vidyadhar85's Avatar
Moderator(The Tutor)
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,518
Thanks: 0
Thanked 5 Times in 5 Posts
use awk

Code:
# dmesg | awk '!/sendmail/&&!/xntpd/{print}'

Sponsored Links
    #5  
Old 06-02-2009
Tirmazi's Avatar
Registered User
 

Join Date: Apr 2008
Location: Maryland, USA
Posts: 81
Thanks: 26
Thanked 1 Time in 1 Post
it works great thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
grep question tim-bobby UNIX for Dummies Questions & Answers 4 10-05-2007 11:58 AM
Question on Grep! bourne Shell Programming and Scripting 5 01-08-2007 08:35 AM
Another grep question kingdbag UNIX for Dummies Questions & Answers 6 10-27-2006 01:56 AM
Grep Question nazri76 UNIX for Dummies Questions & Answers 3 08-18-2006 09:40 AM
grep question Jaken Shell Programming and Scripting 6 05-28-2006 08:24 PM



All times are GMT -4. The time now is 03:14 AM.