2 ms·
.. looking at >1000 LOC bash project this week, with autotools install to make them go.. it uses 'SOURCE' as an include mechanism.. runs FAST and uses lots of w
by mistrial9 8y ago
.. looking at >1000 LOC bash project this week, with autotools install to make them go.. it uses 'SOURCE' as an include mechanism.. runs FAST and uses lots of whitespace, but no one on earth but the original author wants to touch it
- ben509 8y agoIf you want to port such a project: Start by moving code into bash functions if it's not already doing that. Declare variables with `local` to reduce the amount of global state. Once you have code in functions, you can factor code into independent scripts. Anything that runs in a subshell can move into its own script, so anything: 1. in a pipe | line 2. running in the background& 3. in a ( subshell ) 4. that doesn't modify global variables You can then work on those scripts piece by piece.
- zimbatm 8y ago0. run shellcheck and fix all the warnings Using shellcheck will give the developer more confidence in their code, and also learn through the feedback it gives