LX0-103 · Question #46
Which variable defines the directories in which a Bash shell searches for executable commands?
The correct answer is C. PATH. The PATH environment variable lists colon-separated directories the shell searches when resolving executable command names.
Question
Which variable defines the directories in which a Bash shell searches for executable commands?
Options
- ABASHEXEC
- BBASHRC
- CPATH
- DEXECPATH
- EPATHRC
How the community answered
(22 responses)- B9% (2)
- C86% (19)
- E5% (1)
Why each option
The PATH environment variable lists colon-separated directories the shell searches when resolving executable command names.
BASHEXEC is not a defined Bash or POSIX variable and has no effect on command lookup.
BASHRC is the name of a configuration file (~/.bashrc) sourced for interactive shells, not a variable controlling executable search paths.
PATH is a standard POSIX environment variable that contains an ordered, colon-delimited list of directories. When a command is entered without an absolute path, the shell searches each directory in PATH from left to right until the executable is found or all directories are exhausted.
EXECPATH is not a recognized Bash or POSIX variable; it does not exist in the shell environment.
PATHRC is not a defined variable in Bash or POSIX; it has no role in command resolution.
Concept tested: PATH environment variable and command lookup
Source: https://www.gnu.org/software/bash/manual/bash.html#Command-Search-and-Execution
Topics
Community Discussion
No community discussion yet for this question.