0
点赞
收藏
分享

微信扫一扫

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


 变量的取用与设置:echo

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

shell使用学习笔记补充-变量的使用(echo,unset)_子程序_02

 

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

变量设置规则:unset

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

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

 

例子:

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

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

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

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

举报

相关推荐

0 条评论