作者:津pig | 来源:互联网 | 2023-07-24 10:38
export使在父shell中定义的环境变量在子shell中仍然有效。
eg:
- [Oracle@ora10g ~]$ echo $AA
-
- [oracle@ora10g ~]$ echo $BB
-
- [oracle@ora10g ~]$ AA=aaa
- [oracle@ora10g ~]$ BB=bbb
- [oracle@ora10g ~]$ export BB
- [oracle@ora10g ~]$ bash
- [oracle@ora10g ~]$ echo $AA
-
- [oracle@ora10g ~]$ echo $BB
- bbb
- [oracle@ora10g ~]$ exit
- exit
- [oracle@ora10g ~]$ echo $AA
- aaa
- [oracle@ora10g ~]$ echo $BB
- bbb
- [oracle@ora10g ~]$