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 ...
随机推荐
- Sprite(精灵)&& 三个特殊的层Layer
用来作为以后复习使用. 1 #include "ScenceScend.h" CCScene* ScenceScend::scene() { CCScene* s = CCScen ...
- (IEEE-754) 字节数组与浮点数之间的互相转换(MODBUS float类型)
在做上位机开发过程中,经常会碰到字节数组与浮点数,整数等数据之间的转换,有时为了验证数据是否解析正确,得借助于IEEE浮点数工具,本文把基于c#实现的浮点数与字节数组(或16进制的字符串)转换的实现方 ...
- [QT学习]拷贝文件
sourceDir源绝对路径,toDir目标绝对路径 //拷贝文件: bool FileOperation::copyFileToPath(QString sourceDir ,QString toD ...
- R语言拆分字符串
R语言拆分字符串 aaa<-"aa;bb;cc"ccc<-strsplit(aaa,split=";") bbb<- unlist(strsp ...
- JavaScript精要(系列)
JavaScript精要系列 JavaScript精要(六):JavaScript DOM节点和文档类型 JavaScript精要(五):JavaScript数组类型 JavaScript精要(四): ...
- Redis学习-基础环境介绍(二)
1.通过VMware安装了Centos6.8系统 2.Reids安装过程,需要GCC环境 »通过下面命令,根据提示直接安装 1 yum install gcc 3.Redis选用的是3.2.4(建议使 ...
- WPF的学习笔记(1) -- (积累自2016年5月1日 至 2016年6月1日)
敬告读者:因为是事件驱动模式的高速学习,高速学习意味着,不系统,不科学,不合逻辑,不一定正确.所以要是有不对的地方,页面下面留言给我,跪谢! 背景介绍: 最近在公司的开发工作中,接手了从别的公司交代过 ...
- DebugLog 打印方法执行时间
DebugLog 打印方法执行时间 用于方便调试性能问题的打印插件.给访法加上@DebugLog,就能输出该方法的调用参数,以及执行时间. Project gradle配置 // Top-level ...
- Bluetooth Low Energy 嗅探
Bluetooth Low Energy 嗅探 路人甲 · 2015/10/16 10:52 0x00 前言 如果你打开这篇文章时期望看到一些新的东西,那么很抱歉这篇文章不是你在找的那篇文章.因为严格 ...
- [MVC_Json序列化]MVC之Json序列化循环引用
在做MVC项目时,难免会遇到Json序列化循环引用的问题,大致错误如下 错误1:序列化类型为“...”的对象时检测到循环引用. 错误2:Self referencing loop detected f ...