What are environment variables in an operating system?

234 views

What are environment variables in an operating system?

In: 2

4 Answers

Anonymous 0 Comments

They are basically storage spaces for information that you want a program to know that are defined on the level of the operating system, not the program itself.
One example would be the PATH varbiable in something like Linux. It is a pointer to where you find executable programs like Python. You might want to use Python in your script, but don’t know where on the target computer python is located. You can instead call Python and the OS knows that it should look for it at any place specified in the “PATH” environmental variable.

It’s a way of configuring things within your OS and having programs being able to use it, while not having to define it in the program itself (often because you don’t have the information or you don’t want to put it into your code)

You are viewing 1 out of 4 answers, click here to view all answers.