From defff01a51b3e3339ef2571d0321b3ebc6f5ebfc Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+llakala@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:26:38 -0400 Subject: [PATCH] docs: clarify syntax for escaping dollar curlies --- doc/manual/source/language/string-literals.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/manual/source/language/string-literals.md b/doc/manual/source/language/string-literals.md index 8f4b75f3e..ca064989a 100644 --- a/doc/manual/source/language/string-literals.md +++ b/doc/manual/source/language/string-literals.md @@ -150,6 +150,21 @@ These special characters are escaped as follows: `''\` escapes any other character. +A "dollar-curly" (`${`) can be written as follows: +> **Example** +> +> ```nix +> '' +> echo ''${PATH} +> '' +> ``` +> +> "echo ${PATH}\n" + +> **Note** +> +> This differs from the syntax for escaping a dollar-curly within double quotes (`"\${"`). Be aware of which one is needed at a given moment. + A "double-dollar-curly" (`$${`) can be written literally. > **Example**