Tsallaka zuwa abun ciki
Justice Tech School

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.

 FOO

Quiz Test

What does export do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.