Document how to escape double quotes

Issue #1006 closed
B2G2Kmd created an issue

It seems unclear from the documentation how to escape double quotes within strings. I tried \” but it doesn’t work. \0x22 seems to work, but I wonder if there’s a simpler syntax? I think it could be a good addition to the manual to document how to escape them.

At least one other person has had the same question:

https://stackoverflow.com/questions/67721997/how-to-escape-double-quotes-in-monit-config-file

Comments (6)

  1. Tildeslash repo owner

    Did you try single quotes? Something like:

    set mailserver
     smtp.example.com
     port 465
     username example@provider.com
     password 'ex"ample'
     using SSL
    

  2. Dystopian1

    I also wonder how to use arguments with spaces in check program path. None of these works:

    '/bin/sh -c "env >/tmp/test"'

    "/bin/sh -c \0x22env >/tmp/test\0x22"

    "/bin/sh -c \"env >/tmp/test\""

  3. Log in to comment