Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 317
Within a Bash shell, which command adds the current directory to the PATH without overwriting the current PATH for this shell and any subshells that are spawned from the current shell?
Answer options
- A. export $PATH=PATH:$(pwd)
- B. set PATH=$PATH:${pwd}
- C. export PATH=$PATH:$(pwc1)
- D. set PATH=PATH+$(pwd)
Correct answer: A
Explanation
The correct answer is A because it uses 'export PATH=$PATH:$(pwd)' to append the current directory to the existing PATH, allowing it to be recognized by the current shell and subshells. The other options are incorrect due to syntax errors or improper use of environment variable manipulation in Bash.