Site icon Exam4Training

Which command makes the shell variable named VARIABLE visible to subshells?

Which command makes the shell variable named VARIABLE visible to subshells?
A . export $VARIABLE
B . export VARIABLE
C . set $VARIABLE
D . set VARIABLE
E . env VARIABLE

Answer: B

Explanation:

The export command makes the shell variable named VARIABLE visible to subshells. This means that any child process that is spawned from the current shell will inherit the value of VARIABLE. The export command does not need a dollar sign ($) before the variable name, as that would expand the variable to its value. The set command only affects the current shell and does not export the variable to subshells. The env command can be used to run a command in a modified environment, but it does not export the variable to subshells either.

Reference: [LPI Linux Essentials – Topic 105: Shells, Scripting and Data Management]

[LPI Linux Administrator – Exam 102 Objectives – Topic 105: Shells and Shell Scripting]

Latest 102-500 Dumps Valid Version with 194 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version