Standard Shell Exception: pathname of $0

POSIX Standard, section: 3.9.1.1, line: 779-784

When the search for command name using the PATH environment variable succeeds, the command is executed with actions equivalent to calling 'execve()' with the path argument set to the pathname resulting from the search, 'argv[0]' set to the command name and the remaining arguments set to the operands.

if [ $0 = (basename $0) ]; then
	echo "command name: " $0
fi

GNU Exception

When the search for command name using the PATH environment variable succeeds, the command is executed with actions equivalent to calling 'execve()' with the path argument set to the pathname resulting from the search, 'argv[0]' set to the full-path command name and the remaining arguments set to the operands.

if [ $0 = (realpath $0) ]; then
	echo "full pathname: " $0
fi