I tried this:
file=\"myfile\" while read -r line do [[ $line = \\#* ]] && continue \"address=\\$line\\127.0.0.1\" done < \"$file\"
[ "${line:0:1}" = "#" ] && continue
This takes the string, gets the substring at offset 0, length 1:
"${line:0:1}"
and checks if it is equal to #
#
= "#"
and continues looping if so
&& continue
http://www.tldp.org/LDP/abs/html/string-manipulation.html