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 ...
随机推荐
- U-Boot编译过程完全分析
2.1 U-Boot Makefile分析 2.1.1 U-Boot编译命令 对于mini2440开发板,编译U-Boot需要执行如下的命令: $ make m ...
- bzoj 3232 圈地游戏 —— 01分数规划+最小割建图(最大权闭合子图)
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3232 心烦意乱的时候调这道题真是...越调越气,就这样过了一晚上... 今天再认真看看,找出 ...
- 【转】解决从jenkins打开robot framework报告会提示‘Opening Robot Framework log failed ’的问题
最新的jenkins打开jenkins robot framework报告会提示如下 Verify that you have JavaScript enabled in your browser. ...
- ubuntu搭建开发环境踩坑实录
谨以此文,记录和ubuntu系统不死不休的搏斗过程,后续待补. 1.双系统安装,windows采用uefi模式安装(优启通可制作uefi的win10安装盘),ubuntu不要划分boot区,而应该划分 ...
- 377D
树形dp 就是求每个点到标记的点的最大距离 一个经典模型 有一个巧妙的方法,我们求出以这些关键点的直径,然后每个点到关键点的最大距离就是到直径两端的距离 #include<bits/stdc++ ...
- 04_显示意图打开activity
实际上用显式意图打开一个activity就很简单了.只需要指定你要打开的这个activity的class就可以了. 需要注意一点的是创建了一个ThirdActivity必须要在清单文件里面声明.如果没 ...
- css模型
外边距: margin:1px 2px 3px 4px; 上 右 下 左 内边距: padding:1px 2px 3px 4px; 上 右 下 左 边 ...
- bzoj 4813: [Cqoi2017]小Q的棋盘【树形dp】
这么简单的dp我怎么没想到x2 f为从这个点出发后回到这个点最多能走过的点,g为从这个点出发后不回到这个点最多能走过的点,注意g有两种转移:g[u][k]=max(g[u][k],f[u][k-j-1 ...
- bzoj 1006: [HNOI2008]神奇的国度【弦图+LesBFS】
参考论文:https://wenku.baidu.com/view/6f9f2223dd36a32d73758126.html 参考代码:http://hzwer.com/3500.html 虽然会写 ...
- 【底层原理】高级开发必须懂的"字节对齐"
认识字节对齐之前,假定int(4Byte),char(1Byte),short(2Byte) 认识字节对齐 先看段代码: struct Data1 { char a; int b; short c; ...