docs: clarify syntax for escaping dollar curlies

This commit is contained in:
Eman Resu 2024-10-18 13:26:38 -04:00 committed by GitHub
parent 694c378d14
commit defff01a51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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**