3 ms·
> Shellcheck will happily suggest changes that break working code. Which is OK once it is known. Your example nicely shows that. The flagged behavior is often
by acqq 6y ago
> Shellcheck will happily suggest changes that break working code.
Which is OK once it is known. Your example nicely shows that. The flagged behavior is often unexpected, so there where it is expected having shellcheck line that turns off the warning greatly improves readability of the whole script, essentially showing the reader "here is the dependence on non obvious behavior."
Where such dependence exists, I prefer to see the "shellcheck" line before pointing to it (by turning that specific warning off exactly in that line). It's then a "vetted" and "explained" line.