3 ms·
Scripts should be commented with intent. (I can figure out what it is doing, but I have no clue WHY) Scripts should be testable. Scripts should use functions
by csours 3y ago
Scripts should be commented with intent. (I can figure out what it is doing, but I have no clue WHY)
Scripts should be testable.
Scripts should use functions with appropriately scoped variables. (This really helps with testability)
Scripts should list assumptions.
Scripts should CHECK assumptions.
Scripts should call commands with --long-style-options instead of -L, especially uncommon options.
---
As someone who migrated a couple hundred shell scripts over the past year, I'd rather have these done before I ask someone to write a script in C.
edit: and for ${deity} sake, use shellcheck.
- shrimp_emoji 3y ago> Scripts should call commands with --long-style-options instead of -L, especially uncommon options. Too bad `getopts` only supports single-char options. :p
- csours 3y agoI'm not a fan of getopts And to be more specific - I meant when the script calls someone else, not how it handles options.
- jjgreen 3y agoI think you mean "${deity}" in case of spaces ...