![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
aa20274270
这个作者很懒,什么都没留下…
展开
-
Shell -------- 检测utf-8 是否 带bomb
1. 找出带bomb的文件 grep -I -r -l $'\xEF\xBB\xBF' * 2. Vim #设置UTF-8编码 :set fileencoding=utf-8 #添加BOM :set bomb #删除BOM :set nobomb #查询BOM :set bomb? 3. Window上的cygWin 检测出 带bomb文件之后原创 2016-01-22 16:40:41 · 989 阅读 · 0 评论 -
Shell Sed 替换特定行特定字符
参考: http://blog.csdn.net/nfer_zhuang/article/details/44020599 sed -i '/snd-soc-wmt-fm34/s/^#//' /snd-soc-wmt-fm34/表示匹配含有snd-soc-wmt-fm34字符串的行 可以把snd-soc-wmt-fm34写成 正则表达式。 那么上面那句的意原创 2016-11-29 15:28:58 · 15682 阅读 · 0 评论 -
Shell 全局替换
$ grep -r "Debug.Log" * | awk -F : '{print $1}' | sort | uniq | grep ".cs$" | xargs sed -i 's/Debug.Log/Debugger.Log/g' 1. grep -r,递归目录的意思。 2. awk -F : , 是以 :为分界符。原创 2016-11-28 16:10:31 · 1863 阅读 · 0 评论 -
统计代码行数
find . -name "*.java"|xargs wc -l|grep "total"|awk '{print $1}'原创 2017-01-16 17:26:13 · 461 阅读 · 0 评论 -
Shell .sh,for, if, 变量的使用
目前利用CygWin可以运行。 #!/bin/sh #使用变量(等号两边不能有空格) #var="hello" #echo "$var" #for 遍历有file(注意当前路径)("$fileList" 和 $fileList 是有区别的,前者是用字符串包含了所有的路径) #fileList=`find . -name '*.tga'` #for file in $fileList #d原创 2017-04-10 11:37:00 · 2085 阅读 · 0 评论 -
Shell 结合 imagemagick
fileList=`find . -regex '.*\.PNG\|.*\.png\|.*\.TGA\|.*\.tga'` for file in $fileList do echo "$file" fileW=`identify -format "%w" $file` fileH=`identify -format "%h" $file` if [ $fileW == 256 ] |原创 2017-04-10 12:32:12 · 521 阅读 · 0 评论