通常Shell程序将在子Shell中执行,该程序对变量的改变只在子Shell中有效而在当前Shell中无效。
答案:1 悬赏:60 手机版
解决时间 2021-04-12 08:56
- 提问者网友:辞取
- 2021-04-11 15:33
这句话,我不怎么理解。请高手解释,谢谢!!!
最佳答案
- 五星知识达人网友:上分大魔王
- 2021-04-11 17:13
()内的就是子shell 你试试看就明白了
lix@lxLaptop:~/.vim/plugin$ a=1
lix@lxLaptop:~/.vim/plugin$ (echo $a)
1
lix@lxLaptop:~/.vim/plugin$ (a=11;echo $a)
11
lix@lxLaptop:~/.vim/plugin$ echo $a
1
子shell 会继承 当前shell中的变量, 但是子shell中的修改不会影响到 当前shell
lix@lxLaptop:~/.vim/plugin$ a=1
lix@lxLaptop:~/.vim/plugin$ (echo $a)
1
lix@lxLaptop:~/.vim/plugin$ (a=11;echo $a)
11
lix@lxLaptop:~/.vim/plugin$ echo $a
1
子shell 会继承 当前shell中的变量, 但是子shell中的修改不会影响到 当前shell
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯