You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rule Id (if any, e.g. SC1000): SC2054, SC2206, SC2086
My shellcheck version (shellcheck --version or 'online'): online
I tried on shellcheck.net and verified that this is still a problem on the latest commit
It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue
Here's a snippet or screenshot that shows the problem:
#!/bin/bash
g='Pictures/*'
a=(
-ld
# shellcheck disable=SC2206,SC2086$g
)
ls "${a[@]}"
Here's what shellcheck currently says:
Line 4 SC2054: Use spaces, not commas, to separate array elements.
Line 7 SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
Here's what I wanted or expected to see:
Nothing. The comma is in a comment, so isn't used to separate array elements. The disable directive comment should prevent the other issues, but is ignored in the array.
Context
Using an array for args because bash does not support comments interspersed with line continuations, without using hacks. So I can't write:
For bugs
shellcheck --version
or 'online'): onlineHere's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
Nothing. The comma is in a comment, so isn't used to separate array elements. The disable directive comment should prevent the other issues, but is ignored in the array.
Context
Using an array for args because bash does not support comments interspersed with line continuations, without using hacks. So I can't write:
The text was updated successfully, but these errors were encountered: