
sh
hai0808
这个作者很懒,什么都没留下…
展开
-
shell + mysql
#!/bin/bashecho "测试...................."MYSQL="mysql -h127.0.0.1 -P3306 -uroot -p123456 mysqldb"selectMaxOrderId="select max(F_id) from t_order"cnt=$($MYSQL -s -e "${selectMaxOrderId}")orderIds=...原创 2018-01-22 16:00:27 · 660 阅读 · 0 评论 -
grep命令
打印匹配的前后5行grep -5 “searchstring” /* -Rgrep -C 5 “searchstring” /* -R打印匹配的前5行grep -B 5 “searchstring” /* -R打印匹配的后5行grep -A 5 “searchstring” /* -R打印匹配的前3个结果grep -A 5 -m3“searchstri原创 2018-02-01 11:17:48 · 486 阅读 · 0 评论 -
shell 操作mysql
#!/bin/bashentime="`date +'%Y-%m-%d'` 00:00"bgtime="`date +'%Y-%m-%d' -d '-1 days'` 00:00"date="`date +'%Y-%m-%d' -d '-1 days'`"conn="mysql -h 127.0.0.1 -ul -P3306 -pl -Dtest --default-character-se...原创 2018-04-11 12:01:41 · 139 阅读 · 0 评论 -
shell 脚本中双引号、单引号、反引号的区别
iamlaosong文最近要编个shell脚本处理数据,需要检测数据文件是否存在,文件名中包含日期,所以需要生成最近几天的日期,以便检测文件是否存在,看下面的脚本中如何使用双引号、单引号、反引号:[plain] view plain copyOPDATE=`date -d '-1 day' +%Y%m%d` for i in $(seq 10) do FILEDATE=`date ...转载 2018-04-23 09:23:43 · 410 阅读 · 0 评论 -
搜索文件夹下包含的文件
#!/bin/bashcat ./id.txt | while read linedores=`grep $line ../* -R -s`if [ -z "$res" ] ##&& [ "$res" != " " ];thenecho $line "无"elseecho $line ...原创 2019-07-23 14:14:31 · 180 阅读 · 0 评论