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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Course Machine Learning Note

    Machine Learning Note Introduction Introduction What is Machine Learning? Two definitions of Machine ...

  4. 2014/09/30 Learning Note

    Vbird Linux: Vim Learning: http://linux.vbird.org/linux_basic/0310vi.php Bash Shell: http://linux.vb ...

  5. Shell study note

    td p { margin-bottom: 0in } p { margin-bottom: 0.1in; line-height: 120% } a:link { } 5.1 printenv vi ...

  6. [Angular2] @Ngrx/store and @Ngrx/effects learning note

    Just sharing the learning experience related to @ngrx/store and @ngrx/effects. In my personal opinio ...

  7. Machine Learning Note Phase 1( Done!)

    Machine Learning 这是第一份机器学习笔记,创建于2019年7月26日,完成于2019年8月2日. 该笔记包括如下部分: 引言(Introduction) 单变量线性回归(Linear ...

  8. Inheritance Learning Note

    好几天没来学习了,昨晚把继承的又整理了一下.想把整理后的东西发到hexo博客上来,却发现命令行又失效了.前几天明明是好的,这几天又没有进行任何操作,网上搜了一下也没有招到合适的解决办法,无奈只能重装了 ...

  9. Machine Learning Note

    [Andrew Ng NIPS2016演讲]<Nuts and Bolts of Applying Deep Learning (Andrew Ng) 中文详解:https://mp.weixi ...

随机推荐

  1. bzoj2743 [HEOI2012]采花——树状数组+离线

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2743 和 HH的项链 那道题很像,也是类似的做法: 但不同的是这里的点只有有前驱时才起作用: ...

  2. RTMP直播到FMS中的AAC音频直播

    本文引用了下面几个网友的文章: http://sun3eyes.blog.163.com/blog/#m=0&t=3&c=rtmp http://sun3eyes.blog.163.c ...

  3. STM32F4 LTDC学习

    很久没有写东西了,也很久没看文档了吼吼,觉得有点无聊,找来F4看看,主要看F429.督促自己多看多记录. 首先配置同步时序先看参考手册 下面看一个实际例子,一块439的开发板 设置: LTDC_Ini ...

  4. asp.net MVC 切换网站主题

    首先要有一些定义后的CSS文件,本例是用Bootstrap作为前端框架,可以从http://bootswatch.com/网站上下载一些主题文件,也就是一些定义好的Bootstap.css的文件. 然 ...

  5. UVa 11401 Triangle Counting (计数DP)

    题意:给定一个数 n,从1-n这些数中任意挑出3个数,能组成三角形的数目. 析:dp[i] 表示从1-i 个中任意挑出3个数,能组成三角形的数目. 代码如下: #pragma comment(link ...

  6. eclipse集成lombok注解不起作用

    安装步骤: 步骤一:lombok的下载地址为:https://projectlombok.org/download,jar包很小.这里也把依赖写出来: <dependency> <g ...

  7. E20180205-hm

    insensitive adj. 不敏感的; 感觉迟钝的; (对某事物) 无感觉的; (对变化) 懵然不知的; occurence 出现,发生; capital  n. 资本; 首都; 资源; 大写字 ...

  8. bzoj 2750: [HAOI2012]Road【spfa+dfs】

    枚举起点做spfa,然后一条边在最短路上的条件是dis[e[i].to]==dis[u]+e[i].va,所以每次spfa完之后,dfs出a[i]表示经过i点的最短路的起点数,b[i]表示经过i点的最 ...

  9. [Swift]编码拾遗

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs ...

  10. 【底层原理】高级开发必须懂的"字节对齐"

    认识字节对齐之前,假定int(4Byte),char(1Byte),short(2Byte) 认识字节对齐 先看段代码: struct Data1 { char a; int b; short c; ...