Shell study note

Posted bob

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Shell study note相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Linux Shell command (Quick Study)

shell脚本实战-1

shell常用命令与工具

shell脚本

shell 正则表达式

     review what i studied `date` - 2017-4-4