Solved

Exclude certain lines for the matching words in the output file

Posted on 2011-09-15
3
415 Views
Last Modified: 2012-08-13
We are pulling a SST audit report. In few server we are running apache or nfs or samba service so we want to exclude line fro the services from output of SST report. It is different for different boxes.

Can I have a file in place with the name of allowed services to exclude the service from the output? Please suggest me how to achieve this and send me the logic how to write this.
0
Comment
Question by:upanwar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Assisted Solution

by:jackiechen858
jackiechen858 earned 250 total points
ID: 36543860
Not sure exactly what you want to do. I think you probably can use awk or grep to do the task. You need to have a original text file with all the services, then write a script to remove those services you don't want.
0
 
LVL 2

Accepted Solution

by:
cyclechip earned 250 total points
ID: 36548692
Type this on the command line:
man grep

Open in new window

...or type it into google. The results will include the following:
-f FILE: Obtain patterns from FILE, one per line.
-v: Invert the sense of matching, to select non-matching lines.
So putting them together, create your "excludeTheseWords.txt" file of words to exclude (with a word on each line), then use the following format:
grep -v -f excludeTheseWords.txt

Open in new window

0
 
LVL 12

Author Closing Comment

by:upanwar
ID: 36548904
Thanks Guys.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question