Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
google site



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
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
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: 69
Thanks: 15
Thanked 0 Times in 0 Posts
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: 6,729
Thanks: 0
Thanked 53 Times in 50 Posts

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

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

Join Date: Apr 2008
Location: Maryland, USA
Posts: 69
Thanks: 15
Thanked 0 Times in 0 Posts
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,504
Thanks: 0
Thanked 0 Times in 0 Posts
use awk

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

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

Join Date: Apr 2008
Location: Maryland, USA
Posts: 69
Thanks: 15
Thanked 0 Times in 0 Posts
it works great thanks
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off


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 07:37 AM.