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. AutoIT: 如何设置GUICtrlCreateCombo选项为不可修改状态

    GUICtrlCreateCombo中选中的选项是可修改的,也可设置为不可修改状态. #include<ComboConstants.au3> GUICtrlCreateLabel(, , ...

  2. bzoj 3781 小B的询问 —— 莫队

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3781 就是莫队,左端点分块排序,块内按右端点排序,然后直接做即可. 代码如下: #inclu ...

  3. hdu 2476 (string painter) ( 字符串刷子 区间DP)

    String painter Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  4. bzoj4720

    期望dp n久以前做过,再做一遍 你只能决定决策,不能决定结果,这是这道题的关键,因为我们换了教室不一定成功,所以我们应该这样设dp状态,dp[i][j][k],第i天,换j次,换没换,转移: dp[ ...

  5. Html.PartialView(),html.Renderpartial,html.action.html.RenderAction 辅助方法

    Html.Partial(), 返回HTML字符串 .参数为部分视图 html.RenderPartial(),不返回返回HTML字符串 ,直接输出响应流.参数为部分视图 一般用于主视图中已经存在了这 ...

  6. J20170524-hm

    取りこぼし 意外地输给较自己实力弱的对手,爆出冷门,败给手下败将 振り分け 分配,整理 スキーマ 图解.模式.图式

  7. ARC102 C~D

    C: 枚举中间点,计算两边点差值,把个数乘起来即可 #include<iostream> #include<cstdio> #include<algorithm> ...

  8. element-ui公用模态框自定义样式与scoped样式生效问题解决方案

    //先插如效果图 里面内容均为传进来的.包括取消与确定按钮,因为每个页面的绑定事件不一样. //下面这个图片为初始样式 //拖动模态框指令需要插件.详情看我下一篇,以下是地址 https://www. ...

  9. 题解报告:hdu 1098 Ignatius's puzzle

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1098 题目中文是这样的: 伊格内修斯在数学上很差,他遇到了一个难题,所以他别无选择,只能上诉埃迪. 这 ...

  10. string.Format 中不能包含{}字符串

    string scss = @"<style type=""text/css""> body{ margin-left: {0}px; m ...