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 |
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 |