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?
The goal is to add the current directory (pwd, which prints the working directory) to the PATH variable without overwriting the existing PATH. The correct way to do this in a Bash shell is:
export PATH=$PATH:$(pwd)
• export → Ensures that PATH is available to subshells.
• $PATH → Keeps the existing PATH values.
• $(pwd) → Expands to the current working directory.
• : → Acts as a separator between paths in PATH.
Its C if its a copy error. This command appends the current directory to the PATH, allowing any executables in this directory to be run without specifying their full path.
C. export PATH=$PATH:$(pwd)
The correct command to add the current directory to the PATH without overwriting the current PATH in the Bash shell is:
C. export PATH=$PATH:$(pwd)
I think the answer had an issue with OCR (converting image to text)
Answer C is accurate, just some bad OCR.
When you set a variable in Linux, you don't use the $, so A is wrong.
You only use a $ when referring to a variable, so C should be:
export PATH=$PATH:$(pwd)
pwc1 would be a very common mistake for an OCR algo, c1 looks visually similar to d.
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
daniii89
3Â months, 1Â week agodexcript
9Â months, 2Â weeks agojbmac
1Â year, 1Â month agolmqnam
1Â year, 5Â months agoNicetomeetyou
1Â year, 10Â months agothrowaway_account
1Â year, 11Â months agostarbuggs
2Â years agocerifyme85
2Â years, 3Â months agoWoonesuf
2Â years, 2Â months agom4xr1s
2Â years, 2Â months agortg2123
2Â years, 2Â months ago