Shell study note
td p { margin-bottom: 0in }
p { margin-bottom: 0.1in; line-height: 120% }
a:link { }
5.1
printenv |
view Global variables |
bash |
new shell |
set |
Global variables and local |
export test |
Local → Global, so it can be accessed in both subshell and |
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.
# add a alias
echo "alias ll='ls -al'" >> /home/joker/.bashrc
Shell study note的更多相关文章
- shell learning note
shell learning note MAIN="/usr/local/" # 变量大写 STATUS="$MAIN/status" # 美元符加字符串是 ...
- Beginning Scala study note(9) Scala and Java Interoperability
1. Translating Java Classes to Scala Classes Example 1: # a class declaration in Java public class B ...
- Beginning Scala study note(8) Scala Type System
1. Unified Type System Scala has a unified type system, enclosed by the type Any at the top of the h ...
- Beginning Scala study note(7) Trait
A trait provides code reusability in Scala by encapsulating method and state and then offing possibi ...
- Beginning Scala study note(6) Scala Collections
Scala's object-oriented collections support mutable and immutable type hierarchies. Also support fun ...
- Beginning Scala study note(5) Pattern Matching
The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...
- Beginning Scala study note(4) Functional Programming in Scala
1. Functional programming treats computation as the evaluation of mathematical and avoids state and ...
- Beginning Scala study note(3) Object Orientation in Scala
1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...
- Beginning Scala study note(2) Basics of Scala
1. Variables (1) Three ways to define variables: 1) val refers to define an immutable variable; scal ...
随机推荐
- JS验证码
1.引用jquery 2.Html页面 <div> <canvas id="canvas" style="cursor: pointer; height ...
- 【前端】stopPropagation, preventDefault, return false的区别
e.stopPropagation()阻止事件冒泡或者捕获 因为事件可以在各层级的节点中传递, 不管是冒泡还是捕获, 有时我们希望事件在特定节点执行完之后不再传递, 可以使用事件对象的 stopPro ...
- 。tar.gz(bz或bz2等)安装
tar.gz(bz或bz2等) 一.安装1.打开一个SHELL,即终端2.用cd 命令进入源代码压缩包所在的目录3.根据压缩包类型解压缩文件(*代表压缩包名称)tar -zxvf ****.tar.g ...
- js小知识归纳(待续)
1.javascript 中 if (window != top) top.location.href = location.href;的意思 如果当前窗口不是最上层窗口(比如是在Iframe中),那 ...
- 使用idea15搭建基于maven的springmvc-mybatis框架
我这边使用的是intellij idea15 1.new maven webapp project 2.添加groupId和artifactId 3.选择maven路径和maven仓库路径 最后确定之 ...
- php : MVC 演示(使用单例工厂)
此例子是MVC的简单应用, 要达到的效果如下: 用户列表: 姓名 年龄 学历 兴趣 出生地 账号创建时间 操作 keen 20 高中 篮球,足球 广东 2016-11-08 10:00:31 删除 a ...
- 01 初识python
python.exe -v / python3 -v安装python3时, 会得到一个 IDLE(提示符>>>), 简单, 有用, 包含语法编辑器(颜色可变), 调试工具, pyth ...
- TCP/IP协议学习(七) 基于C# Socket的Web服务器---动态通讯实现
目录 (1).基于Ajax的前端实现 (2).Web服务器后端处理 一个完整的web服务器,不仅需要满足用户端对于图片.文档等资源的需求:还能够对于用户端的动态请求,返回指定程序生成的数据.支持动态请 ...
- 解决JS加载速度慢
在网页中的js文件引用会很多,js引用通常为 <script src="xxxx.js"></script> 通过如下方法可以增加js加载速度 <sc ...
- HTTP性能小测试
一直说node.js如何如何好,就来测试一下吧~~ 首先接受一个小工具 Apache Bench简称ab 可以用来测试http性能 利用Apache Bench测试Web引擎性能关于此工具的详细介绍参 ...