egrep -v "^[[:blank:]]*(#|$)" filename
As simple as one single command :
find -type d -empty -delete
sed -e '/^\s*#.*$/d' -e '/^\s*$/d' filename
Powered by WordPress
Filter out comments and empty lines from config files