This question already has an answer here:
Reliable way for a bash script to get the full path to itself? [duplicate]
In school I learned that "$0" would be the name of the script in bash, but when I try to print it, it actually prints -bash instead of the scriptname.
Is there something I missed, or is there another command to get the name of the script?