#!/bin/bash
There, I fixed your "what shell is /bin/sh" problem.
#!/bin/mksh
You aren't administering Android devices.
Stop obsessing about writing portable scripts. Write scripts for the targets that you are going to run them on.
Stop ignoring standards. They exist for important reasons. Invent your existentialism in some other realm.