Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-12-2014, 11:21 AM
|
#1
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Config file "cleaner"?
I have to administer Nagios once again. I was wondering if there was such a thing as a config cleaner that can go through a file, remove all the comments,.. and also standardize spacing and tabbing.
So this: http://fpaste.org/133185/41053870/
Would be cleaned up and look like this: http://fpaste.org/133190/41053880/
Is there a standardizer that can do this with minimal research and learning? I don't want to have to sit in a manual for the next two months to clean 4 files.
|
|
|
09-12-2014, 11:50 AM
|
#2
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Code:
cat /path/to/file/to/clean | grep -v "#" | sed '/^$/d' > new.file
may do it.
But "standardize" spacing? What's that?
Quote:
Originally Posted by szboardstretcher
I don't want to have to sit in a manual for the next two months to clean 4 files.
|
ha!
How about throwing me a bone over at https://www.linuxquestions.org/quest...er-4175518374/?
Last edited by Habitual; 09-12-2014 at 11:54 AM.
|
|
|
09-12-2014, 11:56 AM
|
#3
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
Original Poster
|
That almost works,. but doesn't take care of end of line comments, nor the standardized tabbing/spacing.
Sure.
|
|
|
09-12-2014, 11:57 AM
|
#4
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Quote:
Originally Posted by szboardstretcher
That almost works,. but doesn't take care of end of line comments, nor the standardized tabbing/spacing.
Sure.
|
Some more clever than I can help with that, I'm sure.
I'm not "that good".
|
|
|
All times are GMT -5. The time now is 07:04 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|