shellcheck
: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into "corner cases" every now and then.
Checked my posthook… looks like my bash skills at zero: https://doesnm.cc/huh.txt