From bc07c19622f35f91851301bcfcbbecd52f5e4f5c Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Mon, 16 Aug 2021 21:19:58 -0700 Subject: [PATCH] Created SC2296 (markdown) --- SC2296.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 SC2296.md diff --git a/SC2296.md b/SC2296.md new file mode 100644 index 0000000..9731f77 --- /dev/null +++ b/SC2296.md @@ -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! \ No newline at end of file