Bird
0
0

Which sequence of commands achieves this correctly?

hard📝 Application Q15 of 15
Linux CLI - Environment and Configuration
You want to set a variable CONFIG_PATH to /etc/config and ensure it is available to all scripts run from your current shell session and its children. Which sequence of commands achieves this correctly?
ACONFIG_PATH=/etc/config\nexport CONFIG_PATH
Bexport CONFIG_PATH=/etc/config
Cexport CONFIG_PATH\nCONFIG_PATH=/etc/config
DCONFIG_PATH=/etc/config
Step-by-Step Solution
Solution:
  1. Step 1: Assign variable before export

    Assigning CONFIG_PATH=/etc/config sets the value in the current shell.
  2. Step 2: Export variable after assignment

    Running export CONFIG_PATH marks it for child processes with the assigned value.
  3. Step 3: Check other options

    export CONFIG_PATH=/etc/config works but is less clear; export CONFIG_PATH\nCONFIG_PATH=/etc/config exports before assignment (wrong); CONFIG_PATH=/etc/config does not export.
  4. Final Answer:

    CONFIG_PATH=/etc/config export CONFIG_PATH -> Option A
  5. Quick Check:

    Assign then export to share variable [OK]
Quick Trick: Assign first, then export to share variable [OK]
Common Mistakes:
  • Exporting before assigning value
  • Not exporting variable at all
  • Assuming single export with assignment is always best

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes