Unsolicited review of sync.sh ahoy!<p>The easy stuff:<p>- Non-exported variables are by convention lower_case, while exported variables are UPPER_CASE.<p>- Function names are by convention lower_case.<p>- There's a "quite" signature string and variable; should it be "quiet"?<p>- The lines like `local hosts=` can be simplified as `local hosts`. You can also join such lines, as with `export`, into `local foo bar baz …`.<p>- `[[` is generally considered more reliable than `[` (there are a bunch of posts about this on Stack Overflow and Unix Stack Exchange).<p>- Naming scripts .bash rather than .sh lets `shellcheck` inspect them without telling it which shell to verify against. You do check these files using `shellcheck`, right?<p>- Variable names like `list` and `tuple` are unhelpful; what do they actually contain? Also, they should probably be actual arrays rather than a space-separated string to avoid relying on word splitting, and to allow entries with whitespace in them.<p>The scary stuff:<p>- All the string packing and unpacking also makes me nervous. That's not simpler than using JSON/YAML, it's just a different kind of complexity.<p>- Reusing the same variable a bunch of times in the same function makes it really easy to end up with the wrong value at some point. Better to split stuff into more functions or rename the variables to make them single use.<p>- `set -o errexit -o pipefail` would be good to have for safety.<p>- `kill -9` anything[1]<p>- Why are some of the variables inside functions not local? They effectively end up being globals, which makes for really difficult debugging.<p>The good stuff:<p>- Using local variables everywhere.<p>- Descriptive error messages.<p>- Returning early in case of errors.<p>All in all, Bash is not a good language for any system of this size, no matter how diligently you program. The error handling isn't comparable to most mainstream languages, the data types are incredibly limited, and there's no native support of recursive languages like JSON. You've done a great job, but I'm afraid a system like this is doomed to failure from these facts alone.<p><pre><code> [1] https://mywiki.wooledge.org/ProcessManagement#I.27m_trying_to_kill_-9_my_job_but_blah_blah_blah...</code></pre>