Created SC2296 (markdown)

Vidar Holen
2021-08-16 21:19:58 -07:00
parent 6d91fb8564
commit bc07c19622

29
SC2296.md Normal file

@@ -0,0 +1,29 @@
## Parameter expansions can't start with {. Double check syntax.
(or any other character)
### Problematic code:
```sh
echo "Hello ${{name}"
```
### Correct code:
```sh
echo "Hello ${name}"
```
### Rationale:
ShellCheck found a parameter expansion `${something}` that starts with an invalid character. In the example, this was caused by accidentally duplicating the `{` in `${{name}`.
Double check the syntax of what you're trying to do.
### Exceptions:
Some Zsh specific parameter expansions like `${(q)value}` trigger this warning, but ShellCheck does not support Zsh.
### Related resources:
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!