Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1799054
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: LINUX

2006-10-24 11:13:06

我想在当前目录下生成,ar_$i和full_$i文件各10个.
刚开始写的脚本如下:
-------------------------------------
for((i=1;i++;i<=10))   --这种格式是调用c的编程方式,
do
  touch ar_$i;
  touch full_$i;
done;
执行的结果根本不是我想要的.
man bash查到for语句的help
-------------------------------------
for (( expr1 ; expr2 ; expr3 )) ; do list ; done
              First, the arithmetic expression expr1 is evaluated according to the rules described  below  under
              ARITHMETIC  EVALUATION.   The  arithmetic  expression  expr2 is then evaluated repeatedly until it
              evaluates to zero.  Each time expr2 evaluates to a non-zero value, list is executed and the arith­
              metic  expression expr3 is evaluated.  If any expression is omitted, it behaves as if it evaluates
              to 1.  The return value is the exit status of the last command in list that is executed, or  false
              if any of the expressions is invalid.
 
 
 
后来在请教ark后,把脚本修改成如下:
----------------------------------------------------
for((i=1;i<=10;i=i+1))
do
  touch ar_$i;
  touch full_$i;
done;
 
 
 
阅读(1899) | 评论(0) | 转发(0) |
0

上一篇:ln的用法

下一篇:RCV与PR单价不相符?

给主人留下些什么吧!~~