

I honestly think autocorrecting your scripts would do more harm than good. ShellCheck tells you about potential issues, but It’s up to you to determine the correct behavior.
For example, how could it know whether cat $foo
should be cat "$foo"
, or whether the script actually relies on word splitting? It’s possible that $foo
intentionally contains multiple paths.
Maybe there are autofixable errors I’m not thinking of.
FYI, it’s possible to gradually adopt ShellCheck by setting --severity=error
and working your way down to warnings and so on. Alternatively, you can add one-off #shellcheck ignore SC1234
comments before offending lines to silence warnings.
My knife is printf, but my scalpel is gdb.