4 ms·
If 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 amou
by ben509 8y ago
If 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