环境变量

环境变量是我们常常要用到的,下面来介绍一下环境变量(environment variable)

参考维基百科:

An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer.

They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

They were introduced in their modern form in 1979 with Version 7 Unix, so are included in all Unix operating system flavors and variants from that point onward including Linux and macOS. From PC  DOS 2.0 in 1982, all succeeding Microsoft operating systems including Microsoft Windows, and OS/2 also have included them as a feature, although with somewhat different syntax, usage and standard variable names.

 

环境变量是能够影响进程运行的变量,它包含了进程使用到的信息,例如Windows和DOS操作系统中的path环境变量,当要求系统运行一个程序而没有告诉它程序所在的完整路径时,系统除了在当前目录下面寻找此程序外,还应到path中指定的路径去找。

环境变量最早在Unix7中被引入,后来则逐渐被应用到其他系统。

 

补充

在Linux控制台输入env可以直接输出所有的环境变量,包括PATH变量等。输入echo $PATH 可以输出系统路径。

参考来源:维基百科

参考链接:https://en.wikipedia.org/wiki/Environment_variable

posted @ 2018-08-04 21:15  哦摩西罗伊  阅读(645)  评论(0编辑  收藏  举报