Environment Variables and Starting Other Programs

This lesson explains what environment variables are and how they can be used. In the later part of the lesson, we see how a program can start another program.

Environment variables #

The environment that a program is started in generally provides some variables that the program can use. The environment variables can be accessed through the associative array interface of std.process.environment. For example, the following program displays the PATH environment variable:

Get hands-on with 1200+ tech skills courses.