For bugs with existing features
- Rule Id (if any, e.g. SC1000): SC1102, SC2271
- My shellcheck version (
shellcheck --version or "online"): 0.11.0
- [V] The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
- [V] I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit
Here's a snippet or screenshot that shows the problem:
#!/bin/sh
a=1
: "$(( v_${a}=5 ))"
Here's what shellcheck currently says:
[Line 3:](javascript:setPosition(3, 4))
: "$(( v_${a}=5 ))"
^-- [SC1102](https://www.shellcheck.net/wiki/SC1102) (error): Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors.
^-- [SC2271](https://www.shellcheck.net/wiki/SC2271) (error): For indirection, use arrays, declare "var$n=value", or (for sh) read/eval.
Here's what I wanted or expected to see:
Assigning integers via indirection (and also getting values via indirection) inside arithmetic expansion seems to be universally supported by POSIX-compliant shells: I tested with bash, dash, Busybox ash, ksh93u+m, yash and this works on all of them. I'm not entirely sure whether this is technically 100% POSIX-compliant but I think it might be.
So I expected to see no errors or warnings.
For bugs with existing features
shellcheck --versionor "online"): 0.11.0Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
Assigning integers via indirection (and also getting values via indirection) inside arithmetic expansion seems to be universally supported by POSIX-compliant shells: I tested with bash, dash, Busybox ash, ksh93u+m, yash and this works on all of them. I'm not entirely sure whether this is technically 100% POSIX-compliant but I think it might be.
So I expected to see no errors or warnings.