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 ...
随机推荐
- 关于小黄车(ofo共享单车)使用的问题
小黄车即ofo共享单车,号称是全球创立最早.成长最快.规模最大的无桩共享单车创业公司,缔造了"共享单车"概念,致力于解决城市出行问题.它的出现给大家带来了方便,作为一个商业运行的公 ...
- Ubuntu .deb包安装方法
使用apt-get方法安装的软件,所有下载的deb包都缓存到了/var/cache/apt/archives目录下了,所以可以把常用的deb包备份出来,甚至做成ISO工具包.刻盘,以后安装Ubuntu ...
- Subtitute
报表导出到Excel时,日期已经被格式化,有时候日期格式带星期几,比方说"2016-12-30 星期五",或者是"2016/12/30 星期五". 我不想要星期 ...
- 正尝试在 OS 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样...
出错提示: 正尝试在 OS 加载程序锁内执行托管代码.不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样做会导致应用程序挂起. 原因分析: .NET2.0中增加了42种非常强大的调试助手 ...
- Java中的四舍五入
经典案例分析:public class RoundTest { public static void main(String[] args) { System.err.printl ...
- JavaScript中数组迭代方法(jquery)
var arr = [1,2,4,5,6]; //1.forEach(让数组中的每一项做一件事)arr.forEach(function(item,index){ console.log(ite ...
- 微信,qq,微博如何不用每次清缓存就能看到h5修改过的结果
描述:每次在对js,和css进行修改,想要在微信,微博或则qq里面预览效果,会发现没有生效,那是因为这些客户端会将静态进行缓存,我们需要清理缓存才能看到修改过的效果,但是每次清理缓存会很麻烦,影响开发 ...
- kali安装java1.7
1.先去这里下载你需要的版本 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 我 ...
- 23.mysql集群(master-master)
参考: http://blog.csdn.net/mr__fang/article/details/8692480 http://www.2cto.com/database/201201/116756 ...
- cocos2dx解决苹果正版ipv6的问题
苹果官方出了新的规定,要求新上架的app都必须单独支持ipv6-only的网络. 具体的要求链接:https://developer.apple.com/library/mac/documentati ...