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 ...
随机推荐
- 【前端】CommonJS的模块加载机制
CommonJS的模块加载机制 CommonJS模块的加载机制是,输入的是被输出的值的拷贝.也就是说,一旦输出一个值,模块内部的变化就影响不到这个值. 例如: // lib.js var counte ...
- Boost学习笔记(二) 时间与日期
timer库概述 timer库包含三个组件:分别是计时器类timer.progress_timer和进度指示类progress_display timer 主要作用是计时,精确度是毫秒级.下面是一个简 ...
- Web String path问题
request.getContextPath()"下方出现了红色的波浪线,提示的错误信息是 "The method getContextPath() from the type H ...
- 微信小程序-表单组件
button 按钮 注:button-hover 默认为{background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;} 示例代码: /** wxss **/ ...
- Bootstrap使用初涉
在这里记录一下搭建Bootstrap的开发环境: 首先手头上的有Bootstrap的相关资料,这里用的是bootstrap-3.3.5-dist. 在开发一个Web项目的时候要将述的资料都导入到项目中 ...
- DTP激活时报Overlapping
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Android自定义View的三种实现方式
在毕设项目中多处用到自定义控件,一直打算总结一下自定义控件的实现方式,今天就来总结一下吧.在此之前学习了郭霖大神博客上面关于自定义View的几篇博文,感觉受益良多,本文中就参考了其中的一些内容. 总结 ...
- PHP动态实例化对象并向构造函数传递参数
在框架开发,模块化开发等场合,我们可能有一种需求,那就是在PHP运行时动态实例化对象. 什么是动态实例化对象呢?我们先来看一下PHP有一种变量函数(可变函数)的概念,例如如下代码: function ...
- ASP.NET 页面间传递参数的方法
http://www.cnblogs.com/eoiioe/archive/2008/04/08/1142247.html
- Reconstruction
/* Reconstruction */ /*@mixin border($position){ @if $position == left-right or $position == ...