https://www.bublina.eu.org/posts/2017-05-11-posix_shell_dirname_replacement/
a="/$0"; a="${a%/*}"; a="${a:-.}"; a="${a##/}/"; BINDIR=$(cd "$a"; pwd)