Start of change

Command execution

If a command name contains no slashes, the shell attempts to locate it. If there exists a shell function by that name, the function is invoked as described in Functions. If there is a shell built-in by that name, the built-in is invoked.

Otherwise, the shell searches each element of $path for a directory containing an executable file by that name. If the search is unsuccessful, the shell prints an error message and returns a nonzero exit status.

If execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a shell script. /bin/sh is spawned to execute it. If the program is a file that begins with '#!', the remainder of the first line specifies an interpreter for the program. The shell will execute the specified interpreter on operating systems that do not handle this executable format in the kernel.

If no external command is found but a function command_not_found_handler exists the shell executes this function with all command line arguments. The return status of the function becomes the status of the command. If the function wants to mimic the behavior of the shell when the command is not found, it should print the message command not found: CMD to standard error and return status 127. Because the handler is executed in a subshell forked to execute an external command, changes to directories, shell parameters, and so forth have no effect on the main shell.

End of change