Environment Variable

noun

say it: “en-VY-run-ment VAIR-ee-uh-bul” /ɛnˈvaɪrənmənt ˈvɛəriəbəl/

A named setting, such as the user name or the temp folder, that the computer gives to every program it starts.

What is an environment variable?

An environment variable is a named setting that Windows, macOS and Linux hand to every program they start, such as the user's name, the temp folder and PATH. Programs read them to fit in with the computer they run on. In PowerShell, $env:NAME reads or sets one for this session.

$env:USERNAME         # Sam
$env:POWER = 'on'     # programs started from here can read it

In a sentence

  • “TEMP is an environment variable that tells programs where to put scratch files.”
  • “The kettle-bot script reads the environment variable POWER before it starts.”

Level: Apprentice · More Operating System terms at this level

Updated

In other subjects