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 ...
随机推荐
- [转]python_常用断言assert
原文地址:http://www.jianshu.com/p/eea0b0e432da python自动化测试中寻找元素并进行操作,如果在元素好找的情况下,相信大家都可以较熟练地编写用例脚本了,但光进行 ...
- bzoj 2157: 旅游【树链剖分+线段树】
裸的树链剖分+线段树 但是要注意一个地方--我WA了好几次才发现取完相反数之后max值和min值是要交换的-- #include<iostream> #include<cstdio& ...
- 【HDU - 1241】Oil Deposits(dfs+染色)
Oil Deposits Descriptions: The GeoSurvComp geologic survey company is responsible for detecting unde ...
- poj 2195 Going Home (km算法)
题目链接: http://poj.org/problem?id=2195 解题思路: 把man和home都提取出来,然后算出每个man和home的距离算出来,然后建立匹配图,套用km算法的模板,求最小 ...
- 题解报告:poj 3061 Subsequence(前缀+二分or尺取法)
Description A sequence of N positive integers (10 < N < 100 000), each of them less than or eq ...
- Linux环境下HDFS集群环境搭建关键步骤
Linux环境下HDFS集群环境搭建关键步骤记录. 介质版本:hadoop-2.7.3.tar.gz 节点数量:3节点. 一.下载安装介质 官网下载地址:http://hadoop.apache.or ...
- E. Comments dfs模拟
http://codeforces.com/contest/747/problem/E 首先,把字符串变成这个样子. hello,2,ok,0,bye,0,test,0,one,1,two,2,a,0 ...
- ABP教程(三)- 开始一个简单的任务管理系统 – 后端编码
上一篇 我们介绍了什么是ABP,这一篇我们通过原作者的”简单任务系统”例子,演示如何运用ABP开发项目 创建实体 一般来说任务是需要分配给人来做的,所以我们创建两个实体模型类:Task和Persion ...
- npm安装淘宝镜像cnpm报错npm ERR! errno -4048
今天在安装淘宝镜像的时候报错了,第一次遇上,表示很懵逼 然后捣腾了半天以为是npm install 的时候出错,后来网上查到是 装淘宝镜像cnpm的时候报错,好像是权限问题,解决方法: npm ca ...
- 唤醒键盘时取消对特定类的position:fixed定位
/* 唤起键盘时取消对特定类的position:fixed定位 */ var windheight = $(window).height(); /*未唤起键盘时当前窗口高度*/ $(window).r ...