Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

Lines that begin with the hash character "#" are considered comments, and are ignored

8

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy