mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-03-12 12:35:25 -07:00
Created SC2301 (markdown)
parent
0ea863c99d
commit
1eb42fadfa
29
SC2301.md
Normal file
29
SC2301.md
Normal file
@ -0,0 +1,29 @@
|
||||
## Parameter expansion starts with unexpected quotes. Double check syntax.
|
||||
|
||||
### Problematic code:
|
||||
|
||||
```sh
|
||||
echo ${"Hello World"}
|
||||
```
|
||||
|
||||
### Correct code:
|
||||
|
||||
```sh
|
||||
echo $"Hello World"
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
||||
ShellCheck found a parameter expansion `${...}` that contains an unexpected syntax element, such as single or double quotes.
|
||||
|
||||
In the example, this was due to wrapping a translated string `$".."` with curly braces, which is not valid.
|
||||
|
||||
It is unclear what the intention is with invalid expansions like `${'foo'}`, `${$"foo"}`, so please look up how to do what you were trying to do.
|
||||
|
||||
### Exceptions:
|
||||
|
||||
If this warning triggers for working code, please [submit a bug](https://github.com/koalaman/shellcheck/issues/new).
|
||||
|
||||
### Related resources:
|
||||
|
||||
* Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
|
Loading…
x
Reference in New Issue
Block a user