QuestionQ191

Essential Commands

What is the purpose of the Bash built-in export command?

  • A It allows disks to be mounted remotely.
  • B It runs a command as a process in a subshell.
  • C It makes the command history available to subshells.
  • D It sets up environment variables for applications.
  • E It shares NFS partitions for use by other systems on the network.
Explanation

The export command in Bash marks a variable so that it is passed into the environment of child processes (subshells and any programs launched from the shell), rather than remaining a purely local shell variable. This is how environment variables such as PATH, EDITOR, or application-specific settings are made available to programs and scripts that the shell executes, which is why it is used to set up environment variables for applications.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!