Recall & Review
beginner
What does the
export command do in Linux?The
export command sets environment variables so that they are available to child processes started from the current shell.Click to reveal answer
beginner
How do you make a variable named
MY_VAR available to other programs using export?You write:
export MY_VAR=value. This sets MY_VAR and exports it to child processes.Click to reveal answer
beginner
What happens if you set a variable without
export?The variable exists only in the current shell and is not passed to child processes or other programs.
Click to reveal answer
beginner
How can you see all exported environment variables in your current shell?
Use the command
export -p or printenv to list all exported environment variables.Click to reveal answer
intermediate
Can you export a variable that was already set without reassigning it?
Yes, just run
export VARIABLE_NAME to export an existing variable without changing its value.Click to reveal answer
What does the
export command do?✗ Incorrect
The
export command marks variables to be passed to child processes.Which command exports a variable named
PATH with a new value?✗ Incorrect
Only
export PATH=/usr/bin sets and exports the variable.If you set a variable without
export, what happens?✗ Incorrect
Variables without
export stay local to the current shell.How do you list all exported variables?
✗ Incorrect
The command
export -p lists all exported variables.Can you export a variable without assigning a new value?
✗ Incorrect
You can export an existing variable by just running
export VARIABLE_NAME.Explain in your own words what the
export command does and why it is useful.Think about how programs get information from the shell.
You got /3 concepts.
Describe the difference between setting a variable with and without
export.Consider where the variable can be seen or used.
You got /3 concepts.