101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 62


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.)

Show Answer
Correct Answer: AB

In Bash, to execute a file without starting a subshell, you can use either the 'source' command or its shorthand '.'. The 'source /usr/local/bin/runme.sh' command and the '. /usr/local/bin/runme.sh' command both execute the instructions in the current shell environment, avoiding the overhead of creating a subshell. Therefore, these are the two correct options.

Discussion

2 comments
Sign in to comment
deewetdvjbmnjkjytfdszxcOptions: AD
Jul 25, 2020

A+D is the answer

DuboisNicolasDuclairOptions: BD
Oct 21, 2023

The two commands that directly execute the instruction from the file /usr/local/bin/runme.sh without starting a subshell are: B. `. /usr/local/bin/runme.sh` D. `/usr/local/bin/runme.sh` Both of these options execute the script in the current shell environment, not in a subshell. The dot `.` (option B) is used as shorthand for the `source` command.