-
Notifications
You must be signed in to change notification settings - Fork 113
Milestone
Description
Describe the bug
Range expressions (a..b, a..=b) generate a printf call containing "$((seq ...", which ShellCheck flags as error SC1102. The $(( token is ambiguous: shells and ShellCheck parse it as the start of an arithmetic expansion $((...)) rather than a command substitution $( wrapping a grouped command (seq ...).
Amber version: dd1b7dc
To Reproduce
main {
echo(0..10)
}
echo '
main {
echo(0..10)
}
' | cargo run -- build - - | shellcheck --format gcc -Generated Bash:
printf '%s\n' "$((seq -f "%.0f" -- 0 9 || seq -- 0 9) | paste -sd " " -)"
# ^^^
# parsed as $(( arithmetic )) by ShellCheck and POSIX shellsShellCheck output:
-:4:16: error: Shells disambiguate $(( differently or not at all. For $(command substitution), add space after $( . For $((arithmetics)), fix parsing errors. [SC1102]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels