Which command makes the shell variable named VARIABLE visible to subshells?
Which command makes the shell variable named VARIABLE visible to subshells?
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.
export VARIABLE is correct. (without $ to create and export, while with $ to call it with echo)
Tested on Ubuntu 20.04. Answer E is correct.
how is that correct?
export VARIABLE -> the command 'export' create a variable (named VARIABLE) and you can see the value in all sub shell with echo $VARIABLE
Exactly