Skip to content

Commit

Permalink
Merge pull request #11717 from llakala/patch-1
Browse files Browse the repository at this point in the history
docs: clarify syntax for escaping dollar curlies
  • Loading branch information
tomberek authored Oct 21, 2024
2 parents 63e6672 + defff01 commit 1ed1663
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 1ed1663

Please sign in to comment.