Environment Variable in Shell

Level 240 keystrokes

export sets an environment variable that child processes can access.

Shell code

# export sets API_KEY and makes it visible to child processes
# && runs echo only if export succeeded; it prints: abc123
1export API_KEY="abc123" && echo $API_KEY

Output

abc123
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Shell code and how often they appear.

  • _× 2
  • "× 2
  • &× 2
  • =× 1
  • $× 1

More Shell examples at level 2

← Shell typing practice