Intermediate Linux & Shell Scripting
Q60 / 100

What is the purpose of "export" when used with a variable in bash, e.g. "export VAR=value"?

Correct! Well done.

Incorrect.

The correct answer is A) It marks the variable as an "environment variable" that will be inherited by child processes spawned from the current shell, as opposed to a regular shell variable which is local to the current shell only

A

Correct Answer

It marks the variable as an "environment variable" that will be inherited by child processes spawned from the current shell, as opposed to a regular shell variable which is local to the current shell only

Explanation

Without "export", a variable is only visible in the current shell; exporting it adds it to the environment passed to any subprocesses (like scripts or programs) launched from that shell.

Progress
60/100