I have a bash script that will need to be executed using the bash built-in source. But it needs to read its own filename and update PATH based on it. Unfortunately, $0 does not contain the name of the script. So the following does not work.
ABSDIR=$(pwd)/$(dirname "$0")
export PATH="$ABSDIR/Library/Developer/CommandLineTools/usr/bin:$PATH"
Is there a way to get the name of the script file in this context?
source ~/CLTools/Clang-5.0/activate