当前位置: 代码迷 >> 综合 >> shell使用学习笔记补充-变量的使用(echo,unset)
  详细解决方案

shell使用学习笔记补充-变量的使用(echo,unset)

热度:5   发布时间:2023-12-13 12:34:11.0

 变量的取用与设置:echo

 

若该变量需要在其他子程序执行,则需要以 export 来使变量变成环境变量:
“export PATH”

 

 

变量设置规则:unset

取消变量的方法为使用 unset :“unset 变量名称”例如取消 myname 的设置:
“unset myname”

https://www.showapi.com/book/view/2089/88

 

例子:

环境变量=全域变量
自订变量=区域变量

  相关解决方案