码迷,mamicode.com
首页 > 系统相关 > 详细

Shell study note

时间:2016-10-07 01:12:57      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:

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-defined variables are lower-cased; while sys variables are upper.

test=testing;

remember there is no BLANK;

bash: new a shell, the subshell has no $test variable for it is user-defined; so it is with the subshell.

To fix this, we can “export test”, and NO $ needed.

When unset a global var, it only influent the subshell who execute this cmd.

Shell study note

标签:

原文地址:http://www.cnblogs.com/xiaochou/p/Shell_study_note.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!