[SOLVED] Need to parse numeric values and file paths from a security scan output.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Need to parse numeric values and file paths from a security scan output.
How can I parse a text output to pull out sections delineated by numeric values along with file paths? Example of input data is below. I attempted using awk and sed commands in a script file, but can't quite figure out how to get the output into sections with the appropriate numerical heading and just the file paths. Any good suggestions?
Plugin Plugin Name Severity
1000365 6.6 Find Unauthorized World-Writable Files "6.6 Find Unauthorized World
-Writable Files " : [FAILED] - error message: The following files are world wri
/etc/jlumachine.id owner: root, group: root, permissions: 0666
/opt/Symantec/LiveUpdate/liveupdt.log owner: root, group: root, permissions: 06
Plugin Plugin Name Severity
1000366 6.7 Find Unauthorized SUID/SGID System Executables "6.7 Find Unauthoriz
ed SUID/SGID System Executables" : [FAILED] - error message: The following file
s are SUID or SGID :
/bin/su owner: root, group: root, permissions: 4755
/bin/ping owner: root, group: root, permissions: 4755
/bin/eject owner: root, group:audio, permissions: 4755
/bin/mount owner: root, group: root, permissions: 4755
Last edited by BobbyinMDC; 08-23-2012 at 02:41 PM.
Thank you Byannoni, this really helps. I tried various combos if statements, but I couldn't master the syntax of parsing the number field. I should be able to use this with an elif statement to handle the blank lines, (usually one after each section). Thanks again.