
I quoted and it still tells me i didn't
Oh right. Thanks!
Doing it like srstevenson shows gives me something like:
2524: arguments must be process or job IDs
@erwinkramer In your particular case shellcheck gives a false positive.
Generally any command substitutions should be quoted, but here you actually _need a word splitting_. That's because kill command recognizes a list of PIDs, not a single string with space separated numbers.
Just remove quotes and disable the warning like this:
# shellcheck disable=SC2046
kill -9 $(jobs -p)
Remember that such command will also throw a syntax error if there are no background jobs in your shell session. I humbly suggest to redirect stderr to /dev/null: kill -9 $(jobs -p) 2>/dev/null.
Huh, the arrow is off by four. Something's wrong with the tab handling
Arrow now points to the right thing.
The right thing in this case would be to disable to warning, as in this case word splitting is harmless and desirable.
Most helpful comment
Doing it like srstevenson shows gives me something like:
2524: arguments must be process or job IDs