首页 > 代码库 > Shell study note
Shell study note
<style></style>
5.1
printenv | view Global variables |
bash | new shell |
set | Global variables and local variables |
export test | Local → Global, so it can be accessed in both subshell and main shell. |
unset test | Delete a variable, no $ needed. |
PATH=$PATH:... | append PATH, no “” needed, export needed to make it global. |
.bashrc | define own aliases |
User-definedvariables are lower-cased; while sys variables are upper.
test=testing;
remember there isno BLANK;
bash: new a shell,the subshell has no $test variable for it is user-defined; so it iswith the subshell.
To fix this, we can “export test”, and NO $ needed.
When unset a globalvar, it only influent the subshell who execute this cmd.
Shell study note
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。