mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC2296 (markdown)
29
SC2296.md
Normal file
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!
|
Reference in New Issue
Block a user