Provavelmente você está procurando a matriz BASH_SOURCE
(no bash).
Exemplo:
sourcee.bs
fun(){
echo "$0"
echo "${BASH_SOURCE[0]}"
}
sourcer.bs
#!/usr/bin/env bash
echo "$0"
echo "${BASH_SOURCE[0]}"
source sourcee.bs
fun
testrun
$ ./sourcer.bs
./sourcer.bs
./sourcer.bs
./sourcer.bs
sourcee.bs #Or the full path if it's in PATH instead of the PWD