102-500 Exam QuestionsBrowse all questions from this exam

102-500 Exam - Question 42


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

Show Answer
Correct Answer: E

The 'export' command is used to mark an environment variable to be exported with any newly forked child processes and thus it will be available to subshells. The correct syntax is 'export VARIABLE', without the '$' symbol, which is used only when referencing the value of the variable, not when declaring it.

Discussion

3 comments
Sign in to comment
iwkno6Option: E
Aug 26, 2021

export VARIABLE is correct. (without $ to create and export, while with $ to call it with echo)

CuriousLinuxCatOption: E
Aug 9, 2021

Tested on Ubuntu 20.04. Answer E is correct.

ellen_AA
Mar 7, 2021

how is that correct?

McLaba
Apr 23, 2021

export VARIABLE -> the command 'export' create a variable (named VARIABLE) and you can see the value in all sub shell with echo $VARIABLE

Jodelo
Jul 5, 2021

Exactly