I troubleshoot botched configs very often and I hate seeing the annotations (comment lines), they distract from the main lines in a configuration file, and makes it harder to find the erronous line.
I use this:
grep '^[^#]' /path/to/file
or
grep -vE ‘^\s*(#|$)’ /path/to/file
----------------------------------------------------------------------------------------------------------------------
If you're satisfied with the solutions provided please mark the solution as ACCEPTED.
Don't forget to thank those who helped you out with kudos!Both will strip your config file of lines beginning with a # and blank lines, but the latter also strips those lines which have spaces then the #.
Looking at your reply , I read back the whole post and figured out that I did not read the post properly before.
My reply was there just after reading some of the grep command lol.
My mistake
@kaiser np at all !! :xD
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.