Determining the Location of Your Script in Bash
Updated 2021-04-06: when using the relative pathname to invoke a script, I noticed the most general format wasn’t working properly! I’ve updated the echo $BASH_SOURCE in that form to echo . instead.
binary.phile