For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > sed > Strip Comments And Whitespace From Config Files

Strip Comments And Whitespace From Config Files

Created by dave. Last edited by dave, 219 days ago. Viewed 328 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
(2019-02-15)

Problem

Wordy config files that are all comments and whitespace. We want to see the actual configuration.

Solution

#  sed -e 's/#.*$//g' -e '/^s*$/d' < FILE

(Source: a Stack Overflow post I can't find right now.)

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt