Fundamentals11 / 17
Up next

Environment variables

#!/usr/bin/env bash
# export marks a variable for the environment of child processes
export GREETING="hi"
# a child bash inherits exported variables
bash -c 'echo "child sees: $GREETING"'
# HOME and PATH are standard environment variables
echo "home is $HOME"
What you're solving

export makes a variable visible to child processes