different solution from https://fordodone.com/2013/09/09/read-configuration-files-without-comments-and-spaces/
$ cat cgi.cfg
##
# header
##
conf_var1
conf_var2
# comment
conf_var3
# comments
conf_var4
$ awk '!/^[#]/&&!/^$/' cgi.cfg
conf_var1
conf_var2
conf_var3
conf_var4