Closed K0nne closed 1 month ago
That depends on where the string is used. "abc$def"
is a perfectly valid string literal. Only in places where macros are expanded, their rules have to additionally be followed, for example when variables are used in check commands. Other places like for example passwords in Icinga 2 feature components (i.e. these usually configured in /etc/icinga2/features-enabled/*.conf
) shouldn't need this escaping.
This is not stated anywhere.
There's a note about this where macros are explained:
Note:
When using the
$
sign as single character you must escape it with an additional dollar character ($$
).
A cross reference from the place you linked doesn't sound like a bad idea though.
This whould be helpful!
Today I had to deal with a $ as part of a string and my first try \$ was a bad escape sequence.
Describe the bug
In the section "String Literals Escape Sequence", the
$
is missing. Its escape sequence is$$
. This is not stated anywhere.