2019-02-26 03:12:43 +00:00
|
|
|
# export
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 命令为当前 shell 中的子进程进行环境变量设置。
|
2024-01-01 14:56:36 +00:00
|
|
|
> 更多信息:<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#export>.
|
2019-02-26 03:12:43 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 设置为新的环境变量:
|
2019-02-26 03:12:43 +00:00
|
|
|
|
|
|
|
`export {{某变量名}}={{值}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 删除环境变量:
|
2019-02-26 03:12:43 +00:00
|
|
|
|
|
|
|
`export -n {{某变量名}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 给 PATH 追加新的路径进去:
|
2019-02-26 03:12:43 +00:00
|
|
|
|
2019-10-18 03:33:27 +01:00
|
|
|
`export PATH=$PATH:{{追加的 path 路径}}`
|