nerdexam
Linux_Foundation

LFCS · Question #805

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

The correct answer is A. source /usr/local/bin/runme.sh B. . /usr/local/bin/runme.sh. This question assesses knowledge of how to execute a script within the current shell environment without creating a new subshell process.

Submitted by obi.ng· Apr 18, 2026Essential Commands

Question

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

Options

  • Asource /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
  • Erun /usr/local/bin/runme.sh

How the community answered

(47 responses)
  • A
    87% (41)
  • C
    4% (2)
  • D
    6% (3)
  • E
    2% (1)

Why each option

This question assesses knowledge of how to execute a script within the current shell environment without creating a new subshell process.

Asource /usr/local/bin/runme.shCorrect

The `source` command is a shell built-in that reads and executes commands from the specified file in the current shell environment, meaning no new subshell is created and variables/functions are inherited by the parent shell.

B. /usr/local/bin/runme.shCorrect

The `.` (dot) command is an alias for `source` in Bash, performing the exact same function of executing a script within the current shell context without spawning a subshell.

C/bin/bash /usr/local/bin/runme.sh

`/bin/bash /usr/local/bin/runme.sh` explicitly starts a *new* Bash subshell to execute the script.

D/usr/local/bin/runme.sh

`/usr/local/bin/runme.sh` executes the script by creating a *new* process, typically a subshell, to run it.

Erun /usr/local/bin/runme.sh

`run` is not a standard shell command for executing scripts without creating a subshell.

Concept tested: Executing scripts in current shell environment

Source: https://www.gnu.org/software/bash/manual/bash.html#Bourne-Shell-Builtins

Topics

#Bash Shell#Script Execution#Subshell#Source Command

Community Discussion

No community discussion yet for this question.

Full LFCS Practice