shell learning note
shell learning note MAIN="/usr/local/" # 变量大写
STATUS="$MAIN/status" # 美元符加字符串是引用变量值,而美元符加数字表示命令行参数
echo "some words" >>$STATUS/log.log
echo "test.sh start at `date '+%m/%d %H:%M:%S'`" >>$STATUS/log.log
cat $FILE | grep -v "#" >$OTHERFILE.list # -v剔除#开头的行
year=`date +%Y echo $LINE | awk -F "+" '{print $var}'` # -F以“+”为分隔符“=”等号两边不能有空格 if [ -s "${path}/test.list" ] # 如果文件存在即为非0时为真 []与参数之间必须要有空格[\s$arg\s]
if [ -n "$var1" -o -n "var2" ] #-n 当字符串的长度大于0时为真(串非空) -a,-o,! 逻辑与,或,非
-f file 文件为正规文件为真
# ${args1}_$args2 加上{}是为了更清晰地说明args是变量而不是args_,当遇到多个参数一起时不会混淆变量
then
for LINE in `cat $file`
do
# substr(s,p,n) 返回字符串s中从p开始长度为n的后缀部分 exam:substr($string,,length()) result:s
filename=`echo $LINE | awk -F "+" '{print substr($1,0,1)}'`
expr $value \* $times
if ["$flag" -eq ""]
then
checkFlag=`checkSchedule "${Args1}" "$Args2"` # checkFlag等于checkSchedule函数返回值,$Args1是传入参数
func "$var1" "$var2" #传入var1,2给函数func()
fi
done
fi func()
{
var1=$
var2=$
} Ctrl + v 进入块选择模式,然后移动光标选中你要注释的行,再按大写的I进入行首插入模式输入注释符号如 // 或 #,输入完毕之后,按两下ESC,Vim会自动将你选中的所有行首都加上注释,保存退出完成注释
shell learning note的更多相关文章
- Learning note for Binding and validation
Summary of my learning note for WPF Binding Binding to DataSet. when we want to add new record, we s ...
- Learning Note: SQL Server VS Oracle–Database architecture
http://www.sqlpanda.com/2013/07/learning-note-sql-server-vs.html This is my learning note base on t ...
- Course Machine Learning Note
Machine Learning Note Introduction Introduction What is Machine Learning? Two definitions of Machine ...
- 2014/09/30 Learning Note
Vbird Linux: Vim Learning: http://linux.vbird.org/linux_basic/0310vi.php Bash Shell: http://linux.vb ...
- Shell study note
td p { margin-bottom: 0in } p { margin-bottom: 0.1in; line-height: 120% } a:link { } 5.1 printenv vi ...
- [Angular2] @Ngrx/store and @Ngrx/effects learning note
Just sharing the learning experience related to @ngrx/store and @ngrx/effects. In my personal opinio ...
- Machine Learning Note Phase 1( Done!)
Machine Learning 这是第一份机器学习笔记,创建于2019年7月26日,完成于2019年8月2日. 该笔记包括如下部分: 引言(Introduction) 单变量线性回归(Linear ...
- Inheritance Learning Note
好几天没来学习了,昨晚把继承的又整理了一下.想把整理后的东西发到hexo博客上来,却发现命令行又失效了.前几天明明是好的,这几天又没有进行任何操作,网上搜了一下也没有招到合适的解决办法,无奈只能重装了 ...
- Machine Learning Note
[Andrew Ng NIPS2016演讲]<Nuts and Bolts of Applying Deep Learning (Andrew Ng) 中文详解:https://mp.weixi ...
随机推荐
- AutoIT: 如何从excel中取值并判断条件?
#include <Excel.au3> $excel = _ExcelBookAttach("Book1.xlsx" ,"FileName") ; ...
- Linux中的工作队列
工作队列(work queue)是Linux kernel中将工作推后执行的一种机制.这种机制和BH或Tasklets不同之处在于工作队列是把推后的工作交由一个内核线程去执行,因此工作队列的优势就在于 ...
- mysql 联合2个列的数据 然后呈现出来
SELECT a.voyageNum,CONCAT(a.startDate,'~',a.endDate) AS 日期 FROM tchw_voyageoilcost a ,tchw_voyageoi ...
- (转)理解POCO
POCO的概念是从java的POJO借用而来,而两者的含义是一致的,不同的仅仅是使用的语言不一样.所以POCO的解释就是“Plain Old C# Object”. 从字面上翻译为“纯洁老式的C#对象 ...
- 基于ssh框架web示例
基于ssh框架web示例 介绍 Spring Boot Web 开发非常简单,该示例包括包括目前web开发基本都需要用到的内容 - 序列化(json)输出 - 过滤器(filters) - 监视器(l ...
- iOS NSDictionary <--> NSString(JSON) in Objc
NSDictionary --> NSString + (NSString*)stringINJSONFormatForObject:(id)obj { NSData *jsonData = [ ...
- _bzoj1002 [FJOI2007]轮状病毒【瞎搞】
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1002 这种题真是有毒,很多叼一点的都用matrix tree定理推出了递推公式,也有一些用好 ...
- Codeforces Round #318 [RussianCodeCup Thanks-Round] (Div. 2)
以后每做完一场CF,解题报告都写在一起吧 暴力||二分 A - Bear and Elections 题意:有n个候选人,第一个候选人可以贿赂其他人拿到他们的票,问最少要贿赂多少张票第一个人才能赢 ...
- 题解报告:hdu 2094 产生冠军
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2094 Problem Description 有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打 ...
- 463 Island Perimeter 岛屿的周长
详见:https://leetcode.com/problems/island-perimeter/description/ C++: class Solution { public: int isl ...