You are sourcing a script, not running it. Therefore, you are looking for BASH_SOURCE.
$ cat test.sh
echo $BASH_SOURCE
$ . ./test.sh
./test.sh
Update:
Some people posted that BASH_SOURCE is indeed an array and, while this is actually true, I don't think you need to use all the syntax boilerplate because. "$BASH_SOURCE" (yes, you should quote your variables) will return the first element of the array, exactly what you are looking for.
Said that, it would be useful to post and example of using BASH_SOURCE as an array so here it goes:
$ cat parent.sh
#!/bin/bash
. ./child.sh
$ cat child.sh
#!/bin/bash
. ./grandchild.sh
$ cat grandchild.sh
#/bin/bash
echo "BASH_SOURCE: $BASH_SOURCE"
echo "child : ${BASH_SOURCE[0]}"
echo "parent1 : ${BASH_SOURCE[1]}"
echo "parent2 : ${BASH_SOURCE[2]}"
$ ./parent.sh
BASH_SOURCE: ./grandchild.sh
child : ./grandchild.sh
parent1 : ./child.sh
parent2 : ./parent.sh
.shsuffix on your script: talisman.org/~erlkonig/documents/…