
开发工具 Shell
iteye_8750
这个作者很懒,什么都没留下…
展开
-
在Shell 里做算数运算
做加法: $ x=10$ x=`expr $x + 1`$ echo $x11 或者: $ x=10$ x=$((x+1))$ echo $x11 循环,输出0~10 x=0while [ "$x" -ne 10 ]; do echo $x; x=$((x+1)); done...原创 2012-03-23 23:13:58 · 125 阅读 · 0 评论 -
shell 递归访问文件夹
#!/bin/env bash## usage: addSpace <dir>## example: ./addSpace srcis_directory(){ local DIR_NAME=$1 if [ ! -d $DIR_NAME ]; then return 1 else return 0 fi}...原创 2012-04-11 20:11:15 · 187 阅读 · 0 评论 -
如何使用Shell在每行按顺序输出一个数字
终端输入:echo {1..8} | xargs -n 1 echo输出: 12345678原创 2012-10-24 00:13:56 · 775 阅读 · 0 评论 -
awk 的基本使用举例
$ cat test.txt FrankTesting 1Hello WorldTesT123 Testing bogon:awk-test lihex$ awk '{ print $1 }' test.txt FrankTestingHelloTesT123bogon:awk-test lihex$ awk '{ print $1...原创 2012-10-30 22:50:00 · 159 阅读 · 0 评论 -
把多行文本合并成一行
http://www.unix.com/shell-programming-scripting/109279-merge-multi-lines-into-one-single-line.htmlTry this:Code:sed -e '/^$/d' file| tr '\n' ' 'orCode:awk '{printf("%s",$0)}'原创 2012-12-04 22:27:40 · 1245 阅读 · 0 评论 -
gz压缩包用命令行解压到当前文件夹下
gunzip -c squid-2.7.STABLE9.tar.gz | tar xvf -原创 2012-12-19 22:45:11 · 449 阅读 · 0 评论 -
gsed debug工具
可以打印出sed脚本在执行过程中的pattern区域和当前执行命令的信息http://aurelio.net/projects/sedsed/ 1.txt:aabbcccc 截图:原创 2013-01-27 00:27:23 · 290 阅读 · 0 评论 -
grep 查找文件名含有中文汉字的文件
网站目录下包含大量html文件和子目录,其中有不少文件和目录的名称中含有中文汉字。现希望能用shell脚本罗列出所有名称中含有中文的文件和目录,并统计一下总数。兄弟姐妹们,这个应该怎么搞?真心求解答 find . -type f | grep -P -r "[\x80-\xFF]" | cat | wc -l...原创 2013-03-02 09:53:29 · 6398 阅读 · 0 评论 -
linbpng 开启neon指令优化
libpng version: 1.6.1Ref: http://mortoray.com/2012/08/21/android-ndk-cross-compile-setup-libpng-and-freetype/--------------------------------------------------------------------------------------...原创 2013-04-10 18:35:48 · 548 阅读 · 0 评论