Solved

Exclude certain lines for the matching words in the output file

Posted on 2011-09-15
3
414 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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