Skip to content

Remove all comments and empty lines

cpx March 18, 2010 1 min read bash

Grep will remove all comments and sed will remove all empty lines

# grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'

Same with sed

# cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x