How does "bash" determine command precedence when a command name matches both an alias, a function, a builtin, and an executable in $PATH?
Correct! Well done.
Incorrect.
The correct answer is A) Bash resolves names in this order: aliases (if interactive, unquoted), then functions, then shell builtins, and finally external executables found via $PATH; this can be bypassed using "command", "\name", or quoting to skip aliases
Correct Answer
Bash resolves names in this order: aliases (if interactive, unquoted), then functions, then shell builtins, and finally external executables found via $PATH; this can be bypassed using "command", "\name", or quoting to skip aliases
Understanding this precedence explains common gotchas — e.g. why "\ls" or "command ls" bypasses an alias for "ls", and why defining a shell function named after a common command can shadow the actual executable unless explicitly invoked with its full path.