Skip to content

Commit

Permalink
docs: clarify syntax for escaping dollar curlies
Browse files Browse the repository at this point in the history
  • Loading branch information
llakala authored Oct 18, 2024
1 parent 694c378 commit defff01
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/manual/source/language/string-literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down

0 comments on commit defff01

Please sign in to comment.