The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
grep & cut the file aboorkuma Shell Programming and Scripting 3 06-25-2008 11:01 AM
Grep Log file cbo0485 UNIX for Dummies Questions & Answers 1 05-28-2008 12:24 AM
grep file ali560045 Shell Programming and Scripting 0 01-10-2008 07:51 AM
How to grep a number in a file to find them in another file ahjiefreak Shell Programming and Scripting 7 12-12-2007 06:01 AM
grep for a tar File steiner UNIX for Advanced & Expert Users 1 07-19-2004 12:40 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-24-2009
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
Using grep -v against a file ?

hi there I have a script which outputs hundreds of lines with a servername in each line

eg

Code:

# cat output.txt
server1,problem
server2,problem
server3,problem
server4,problem
server5,problem
server6,problem
server7,problem
server8,problem
...
...
this gets auto-emailed everyday, but our support guys dont want to recieve a list of all servers that have a problem. Whilst they are aware of the issues with, for example, server1 and server3, they dont want to be mailed every day about it, as such, id like to create a file with a list of servers to exclude from the output. eg

Code:
# cat exclude.txt
server1
server3
before emailing my output, id like to perform a kind of 'grep -v' against this file so that my support guys only get mailed about stuff that there not already aware of, so the output would be

Code:
server2,problem
server4,problem
server5,problem
server6,problem
server7,problem
server8,problem
...
...

Is there an easy way of doing this
 

Bookmarks

Tags
egrep, grep exclude

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 06:42 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