exam questions

Exam LX0-103 All Questions

View all questions & answers for the LX0-103 exam

Exam LX0-103 topic 3 question 31 discussion

Actual exam question from CompTIA's LX0-103
Question #: 31
Topic #: 3
[All LX0-103 Questions]

From a Bash shell, which of the following commands directly executes the instruction from the file /usr/local/bin/runme.sh without starting a subshell? (Please select TWO answers.)

  • A. source /usr/local/bin/runme.sh
  • B. . /usr/local/bin/runme.sh
  • C. /bin/bash /usr/local/bin/runme.sh
  • D. /usr/local/bin/runme.sh
  • E. run /usr/local/bin/runme.sh
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
linux_admin
2 years, 2 months ago
B. The command ". /usr/local/bin/runme.sh" (or its equivalent, ". ./runme.sh") is a Bash built-in command that directly executes the instructions in the specified script without starting a subshell. This is also known as sourcing the script, and it allows any variables or functions defined in the script to be available in the current shell.
upvoted 1 times
linux_admin
2 years, 2 months ago
The command source /usr/local/bin/runme.sh executes the commands in the file /usr/local/bin/runme.sh within the current shell environment. Here's a breakdown of what each part of the command does: source is a Bash built-in command that reads and executes commands from a specified file in the current shell environment. It is also equivalent to the "." (dot) command in Bash. /usr/local/bin/runme.sh is the path and filename of the script to be executed. When you run the source command with a script file as an argument, the commands in the script are executed as if you had typed them directly into the terminal. This means that any changes to the environment made by the script (such as setting environment variables or defining functions) persist after the script has finished executing, and they are available in the current shell environment.
upvoted 1 times
...
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago