Many config files use the hash sign # to mark the beginning of a comment. How do I set values that contain such a sign without it being interpreted as a comment?
[edit]
actually, it seems to be a real problem. See for more info
2 Answers
You need to either escape it:
\#or quote it
"#"or
'#'For some config file formats you won't need that as it is only considered a comment when the # is at the beginning of a line, e.g. Apache config files.
8Lines that begin with the hash character "#" are considered comments, and are ignored
I found a workaround: in my case, I had to feed the variable directly in the command line arguments of the program.
e.g.
ssmtp -ap "PasswordWith#InIt" ...it might not work for other programs.
2