![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
Ear_Goth
这个作者很懒,什么都没留下…
展开
-
shell脚本实现把不连续的序号扩成连续
#!/bin/bash#sh replace2.sh demo.txt demo2.txtdeclare -i olddeclare -i iold=0cat $1 | while read line; do arr=(${line// / }) for (( i = $old+1; i < ${arr[0]}; i++ )); do echo ${i} >> $2 done...原创 2018-04-11 22:49:40 · 675 阅读 · 0 评论 -
mr2pat
#!/bin/bashtmp=wywtemp.txtfiles=`awk -F ':' '{print $1}' $tmp`ofc_projs=(aaa bbb ccc)for file in $files;do err=0 ask=0 eval $(echo $file | awk -F '/' '{ if($1!="product"||$2!="cr") { print("err=1"...原创 2018-07-10 01:29:33 · 187 阅读 · 0 评论 -
find funcs from git diff
#!/bin/bashmore diff.txt | awk ' function /* printp(str) */{ print(NR" "str) }BEGIN{ cur=-1 last_func_display="" size=0 still_in_origin_function_flag=1}{ if($1=="diff" || $1=="@@"){ /* printp("1") ...原创 2018-07-13 00:30:24 · 174 阅读 · 0 评论 -
diff_parser.sh
#!/bin/bashsrcfile=new.cdiff=diff.txtfunction parse_src_to_regions(){ gawk 'BEGIN{}{ judge = $0~/^[0-z_]+(\[|\]|\*)*\s+(\[|\]|\*)*[0-z_]+\s*\(.*$/ if (judge){ split($0, strs, "\\(") split(strs[1], s...原创 2018-07-15 19:38:22 · 181 阅读 · 0 评论 -
diff_parser2.sh
#!/bin/bashsrcfile=new.cdiff=diff.txtfunction parse_src_to_regions(){ gawk '{ judge = $0~/^[0-9a-zA-Z_]+(\[|\]|\*)*\s+(\[|\]|\*)*[0-9a-zA-Z_]+\s*\(.*$/ if (judge){ split($0, strs, "\\(") split(strs[...原创 2018-07-16 08:37:42 · 172 阅读 · 0 评论