read configuration files without comments and spaces

Long configuration files have a helpful/annoying amount of comments and explanations about directives. Put this function into your .bashrc to read config files without any comments or white space:

rconf(){ cat "$@" | egrep -v '(#|^\s#*$|^$)' ; }

Then re-load .bashrc file and next time you need to read a config file just:

# rconf <config file>
share:

One thought on “read configuration files without comments and spaces

Leave a Reply

Your email address will not be published. Required fields are marked *