环境变量

本文介绍了环境变量的概念及其在不同操作系统中的作用。环境变量是一组动态命名的值,它们能影响计算机上运行的进程行为。比如,进程可以通过查询TEMP环境变量来找到存储临时文件的位置,或者通过HOME或USERPROFILE变量来发现用户的目录结构。

环境变量是我们常常要用到的,下面来介绍一下环境变量(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

转载于:https://www.cnblogs.com/mlgjb/p/9419939.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值