Multiple choice technology operating systems

What is the command used for changing the scope of a shell variable to a global variable?

  1. global

  2. shell

  3. export

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The export command converts a shell variable into an environment variable, making it available to child processes and subshells. Without export, variables remain local to the current shell. 'global' and 'shell' are not valid commands for changing variable scope in bash or sh.