Writing portable shell script is a little hard, but I've found a good approach is to make something ancient like pdksh a symlink for /bin/sh and even /bin/bash - typically in a small VM. This makes it much more likely that your code will work without big changes on AIX, BSDs, etc. The other way is to use dash, not BusyBox ash, as BusyBox ash includes a few bashisms depending on the configure options at build time.
If you're looking for cross-script ways of solving problems, then feel free to nab implementations from my shellfire repo (https://github.com/shellfire-dev/shellfire et al).