LFCS · Question #859
Which variable defines the directories in which a Bash shell searches for executable commands?
The correct answer is C. PATH. The PATH environment variable is crucial in Bash as it defines the directories where the shell searches for executable commands.
Question
Options
- ABASHEXEC
- BBASHRC
- CPATH
- DEXECPATH
- EPATHRC
How the community answered
(40 responses)- A5% (2)
- B3% (1)
- C90% (36)
- D3% (1)
Why each option
The `PATH` environment variable is crucial in Bash as it defines the directories where the shell searches for executable commands.
`BASHEXEC` is not a standard or recognized environment variable used by the Bash shell to define the search path for executables.
`.bashrc` (or `BASHRC`) is a shell script executed at the start of interactive non-login shells to configure the environment, but it is not the variable itself that defines the command search path.
The `PATH` environment variable is a colon-separated list of directories that the Bash shell systematically searches, in order, to locate and execute commands entered by the user.
`EXECPATH` is not a standard environment variable that Bash uses for locating executable commands.
`PATHRC` is not a standard environment variable in Bash that specifies the directories for command lookup.
Concept tested: Bash PATH environment variable
Source: https://www.gnu.org/software/bash/manual/bash.html#Command-Search-Path
Topics
Community Discussion
No community discussion yet for this question.