摘要: blog:http://blog.csdn.net/HEYUTAO007/article/details/5725379 阅读全文
posted @ 2013-09-30 16:10 dragon_dev 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/ksh#数字段形式for i in {1..10} do echo $i done#详细列出(字符且项数不多)for File in 1 2 3 4 5 do echo $File done#对存在的文件进行循环for shname in `ls *.sh` do name=`echo "$shname" | awk -F. '{print $1}'` echo $name done#查找循环(ls数据量太大的时候也可以用这种方法)for shname in `find . -type f -name "*.sh"` 阅读全文
posted @ 2013-09-30 16:07 dragon_dev 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 这节详细介绍awk内置函数,主要分以下3种类似:算数函数、字符串函数、其它一般函数、时间函数一、算术函数:以下算术函数执行与 C 语言中名称相同的子例程相同的操作:函数名说明atan2( y, x )返回 y/x 的反正切。cos( x )返回 x 的余弦;x 是弧度。sin( x )返回 x 的正弦;x 是弧度。exp( x )返回 x 幂函数。log( x )返回 x 的自然对数。sqrt( x )返回 x 平方根。int( x )返回 x 的截断至整数的值。rand( )返回任意数字 n,其中 0 <= n < 1。srand( [Expr] )将 rand 函数的种子值设置 阅读全文
posted @ 2013-09-30 16:05 dragon_dev 阅读(227) 评论(0) 推荐(0) 编辑