Behind a heavy iron door, the Vault holds the dungeonβs most powerful secrets β not gold and jewels, but the invisible variables that shape every shell. Set them correctly, or the ghost devours you.
= and $VARexport so child processes see itenv and printenv to inspect the shell environment| Command | What It Does |
|---|---|
VAR=value |
Set a shell variable (local to current shell) |
export VAR=value |
Set and export to child processes |
echo $VAR |
Print a variableβs value |
env |
Show all exported environment variables |
printenv VAR |
Print a specific env variable |
unset VAR |
Remove a variable |
export -p |
List all exports in a reusable format |
# Local β child scripts cannot see this:
SECRET=password
# Exported β child scripts and subshells inherit it:
export SECRET=password
# Verify inheritance:
export GREETING="Hello Dungeon"
bash -c 'echo $GREETING' # prints: Hello Dungeon
cd .VAULT # The vault may be hidden β use ls -a
ls -F
# stronghold/ nursery/ lab/ vault_scroll
cat vault_scroll
The scroll explains that each sub-area requires a specific environment variable to be set correctly.
cd stronghold
ls -F
# goblet* inscription
cat inscription
# "The goblet demands the colour of magic. Set MAGIC_COLOR before running ./goblet."
export MAGIC_COLOR="purple"
./goblet
# The goblet glows purple. Correct!
# Vault door unlocked.
Different game sessions may demand different values. Read the inscription carefully.
cd ../nursery
ls
# seeds growth_chart care_notes
cat care_notes
# "PLANT_NAME must be set to continue growing."
export PLANT_NAME="moonflower"
cat growth_chart
The nursery teaches that variables can store any string β command output, paths, names.
cd ../lab
ls -a
# ghost* .formula beakers/
cat .formula
# "To banish the ghost: set GHOST_BANISH to the name found in the beakers."
ls beakers/
cat beakers/vial_7
# Value: "iron_salt"
export GHOST_BANISH="iron_salt"
./ghost
# Ghost banished! The lab is safe.
If
GHOST_BANISHis not set or wrong,./ghostreduces your HP substantially.
env | grep -E "MAGIC_COLOR|GHOST_BANISH|PLANT_NAME"
# MAGIC_COLOR=purple
# GHOST_BANISH=iron_salt
# PLANT_NAME=moonflower
cd ..
ls -F
# vault_key_fragment
cat vault_key_fragment
inventory
# vault key fragment β
| Problem | Cause | Fix |
|---|---|---|
$VAR prints empty |
Variable not exported | Use export VAR=value |
| Ghost still attacks | Wrong value in GHOST_BANISH |
Re-read .formula and beaker vial |
env shows nothing |
Non-exported variable | Use export or check with set | grep VAR |
./goblet says βwrongβ |
Case mismatch | Variable values are case-sensitive |
env and found your variables in the outputContinue your terminal adventure with these resources:
The ghost dissolves. Variables mastered. The vault yields its secrets. π