Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seconding this. Shellcheck is fucking amazing and whenever I visit the wiki page for a specific issue it's extremely descriptive and helps you understand why the flagged behavior is a problem.

Some of the tips are obscure stuff that I never would have realized, like using `command -v` instead of `which` in my (arch) linux install script because command -v is more portable.

And then you have the classic stuff like printf instead of echo -e, using pritnf string formatting, writing `\\n` instead of `\n`, double quoting variables etc



I'm all for "command -v", but do you know which OSes don't have "which" by default?





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: