Bird
0
0

Which of these is the correct way to export a variable named USER_NAME with value alice in bash?

easy📝 Syntax Q3 of 15
Linux CLI - Environment and Configuration
Which of these is the correct way to export a variable named USER_NAME with value alice in bash?
Aexport =USER_NAME alice
Bexport USER_NAME alice
Cexport USER_NAME= alice
Dexport USER_NAME=alice
Step-by-Step Solution
Solution:
  1. Step 1: Understand export syntax

    Export requires the format export VARIABLE=VALUE with no spaces around the equals sign.
  2. Step 2: Evaluate each option

    Only export USER_NAME=alice follows the correct syntax. Options B, C, and D have syntax errors.
  3. Final Answer:

    export USER_NAME=alice -> Option D
  4. Quick Check:

    Correct export syntax = export VARIABLE=VALUE [OK]
Quick Trick: Use export VAR=VALUE with no spaces [OK]
Common Mistakes:
  • Putting spaces around =
  • Using export without =
  • Starting with = sign

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes