Solved

Exclude certain lines for the matching words in the output file

Posted on 2011-09-15
3
411 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
3 Comments
 
LVL 7

Assisted Solution

by:jackiechen858
jackiechen858 earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Guys.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now