Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 101-500 topic 1 question 40 discussion

Actual exam question from LPI's 101-500
Question #: 40
Topic #: 1
[All 101-500 Questions]

From a Bash shell, which of the following commands directly execute the instructions from the file /usr/local/bin/runme.sh without starting a subshell?
(Choose two.)

  • 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: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Negator
Highly Voted 3 years, 1 month ago
Create a script that outputs the shell level environmental variable using "echo $SHLVL". When you execute this script using source or dot (.) it will display 1 showing that the script was executed in the current shell. When you execute the script using full path it will show 2, showing that the script was executed in a subshell.
upvoted 9 times
...
CuriousLinuxCat
Highly Voted 2 years, 9 months ago
A and D is correct. source and . tested on Ubuntu.
upvoted 5 times
...
Ninymo
Most Recent 4 weeks, 1 day ago
Answer: AD
upvoted 1 times
...
Mchoeti
1 year, 1 month ago
right A and D
upvoted 1 times
...
jsteven845
3 years, 1 month ago
A and D
upvoted 3 times
...
mriron
3 years, 4 months ago
A and D are correct, assuming there is a space after (.) point for D . B is wrong , because it execute in the kind shell not in current shell
upvoted 2 times
...
MIU
3 years, 5 months ago
A and D are correct. When you try, just copy and paste from the question. You guys sometimes typo when you try then on your environment....
upvoted 1 times
...
ilputto
3 years, 6 months ago
the correct one is A and D. source <script> and . ./<script> are equivalent
upvoted 4 times
...
Vendo
3 years, 8 months ago
When a script is run using source it runs within the existing shell, any variables created or modified by the script will remain available after the script completes. source is a synonym for dot/period '.' in bash. Be careful! ./ and source are not quite the same. ./script runs the script as an executable file, launching a new shell to run it https://ss64.com/bash/source.html
upvoted 4 times
...
snota45
3 years, 8 months ago
it is A & C
upvoted 1 times
...
Vano1
3 years, 8 months ago
The correct answer is A, B. Verified on CentOS7.
upvoted 1 times
Vano1
3 years, 8 months ago
D is correct if between . (dot) and /usr/loca/bin/runme.sh is a space. This question have 3 correct answer or I don't understand something.
upvoted 2 times
Vano1
3 years, 8 months ago
After some researchers, I choose A and D.
upvoted 3 times
...
...
...
deewetdvjbmnjkjytfdszxc
3 years, 9 months ago
Isn't A+B?
upvoted 2 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 ...