Below are one liners to clean out all comment and blank lines with grep and sed, usually in config files.
grep -v "^#\|^$" <conf_file>
or
grep -v "^\#" <conf_file> | sed '/^$/d'
- sandip's blog
- Login or register to post comments
Below are one liners to clean out all comment and blank lines with grep and sed, usually in config files.
grep -v "^#\|^$" <conf_file>
or
grep -v "^\#" <conf_file> | sed '/^$/d'