Environment Variables
export makes a variable visible to child processes. env and printenv list them.
Example
FOO=bar
bash -c 'echo "child: [$FOO]"'
export FOO
bash -c 'echo "child: [$FOO]"'
FOO=once bash -c 'echo "$FOO"'Result
child: [] child: [bar] once
Exercise
Share with children.
FOOQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.