The special variable $0 represents the name of the executing program. The following shell, if called script.sh would output This program is called script.sh.:
#!/bin/sh echo This program is called $0. exit 0