shellcheck.net icon indicating copy to clipboard operation
shellcheck.net copied to clipboard

Why is this "${varname}:?}" not flaged as an error

Open DirkOsswald opened this issue 2 years ago • 0 comments

I stumbled upon this error introduced by my inapt fat fingers in a bash script: function f { local v="${1}:?}" ... }

What I clearly meant was this: function f { local v="${1:?}" ... }

But the extra, erroneous "}" in the local variable definition was not indicated by this otherwise excelent ShellCheck thingie.

DirkOsswald avatar Nov 16 '22 14:11 DirkOsswald