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 ...
随机推荐
- 关于C语言宏定义 使用do{ xxxx }while()
暂时感觉像是由于":"的原因,关于使用习惯方面的问题!! 下面是copy的: 这样的宏见过么: Cpp代码 #define FOO(x) do {\ some_code_line_ ...
- maven添加sqlserver的jdbc驱动包
http://search.maven.org/中没有sqlserver的jdbc驱动,所以需要本地安装sqljdbc的jar包,然后再在pom里面引入 Step 1 在微软官网下载sqljdbc的j ...
- AFNetworking的POST上传
- (void)download { // 1.创建网络管理者 // AFHTTPSessionManager 基于NSURLSession AFHTTPSessionManager *manager ...
- 设置float之后vertical-align失效
相关博文: 关于Vertical-Align你需要知道的事情 https://segmentfault.com/a/1190000002668492
- lucene 搜索demo
package com.ljq.utils; import java.io.File; import java.util.ArrayList; import java.util.List; impor ...
- MySql的常用命令
Ubuntu下的安装 打开"终端窗口",输入sudo apt-get update-->回车-->"输入root用户的密码"-->回车 输入s ...
- angularjs指令系统系列课程(2):优先级priority,模板template,模板页templateUrl
今天我们先对 priority,template,templateUrl进行学习 1.priority 可取值:int 作用:优先级 一般priority默认为0,数值越大,优先级越高.当一个dom元 ...
- an interview question(1)
声明:本文为博主原创文章,未经博主允许不得转载. 以下是英文翻译: warnning: Copyright!you can't reprint this blog when you not get b ...
- java中String对象的split方法
在java.lang包中有String.split()方法,返回是一个String[]数组,今天碰到一个自己没注意的问题: 1.特殊分隔符 String str1 = "123|456|78 ...
- Opentaps安装小记
这周了解了个MES项目需求,于是乎找了些开源项目了解下,有php+mysql写的weberp,配置起来相当方便,下一版webERP_v4.13,往F:\Apache\htdocs\一放,启动F:\Ap ...