A new environment variable can be exported and assigned a value with a single command.

  • Post author:
  • Post category:Blog
  • Post last modified:September 22, 2023
  • Reading time:1 mins read

A new environment variable can be exported and assigned a value with a single command.
True or False?

  • True 
  • False
Explanation & Hint:

True. In Unix-like shell environments, you can export and assign a value to a new environment variable in a single command. The syntax for doing this varies slightly between different shell languages (such as Bash, sh, etc.), but the general concept remains the same.

For example, in Bash, you can export and assign a value to a new environment variable using a single command:

export MY_VARIABLE="some_value"

This command both creates the environment variable MY_VARIABLE and assigns the value "some_value" to it, making it available to other processes launched from the current shell session.

For more Questions and Answers:

NDG Introduction to Linux II 2.21 | Chapter 1: Advanced Shell Features Exam Answers