免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: zm_wl
打印 上一主题 下一主题

[求助] AIX中如何实现在一个目录下建立连续数字的子目录 [复制链接]

论坛徽章:
10
天蝎座
日期:2013-09-22 22:32:23程序设计版块每日发帖之星
日期:2016-08-07 06:20:00lufei
日期:2016-06-17 17:38:40程序设计版块每日发帖之星
日期:2016-06-12 06:20:002016科比退役纪念章
日期:2016-05-31 15:47:20CU十四周年纪念徽章
日期:2016-05-27 12:24:562015年亚洲杯之阿曼
日期:2015-05-03 21:01:352015年辞旧岁徽章
日期:2015-03-03 16:54:15天蝎座
日期:2013-10-20 21:05:24程序设计版块每日发帖之星
日期:2016-08-11 06:20:00
21 [报告]
发表于 2011-06-28 17:19 |只看该作者
mkdir {1..31}
zooyo 发表于 2011-06-28 17:12



    这个牛叉。。。

论坛徽章:
0
22 [报告]
发表于 2011-06-28 17:47 |只看该作者
#!/bin/sh
for((i=1;i<=31;i++)); do
   mkdir ${i}
done

论坛徽章:
0
23 [报告]
发表于 2011-06-28 18:43 |只看该作者
回复 18# ly5066113


    谢谢,正解! 呵呵

论坛徽章:
0
24 [报告]
发表于 2011-06-29 09:33 |只看该作者
  1. [root@thinkpad ibm]# cd 2010/2011/
  2. [root@thinkpad 2011]# dirlist=`seq -w -s " " 1 31`
  3. [root@thinkpad 2011]# mkdir $dirlist
  4. [root@thinkpad 2011]# ls
  5. 01  03  05  07  09  11  13  15  17  19  21  23  25  27  29  31
  6. 02  04  06  08  10  12  14  16  18  20  22  24  26  28  30
复制代码

论坛徽章:
0
25 [报告]
发表于 2011-06-29 09:37 |只看该作者
#!/bin/sh
for((i=1;i
lzx4456 发表于 2011-06-28 17:47
  1. [root@thinkpad 01]# #!/bin/sh
  2. [root@thinkpad 01]# for((i=1;i<=31;i++));do
  3. > mkdir ${i}
  4. > done
  5. [root@thinkpad 01]# ls
  6. 1   11  13  15  17  19  20  22  24  26  28  3   31  5  7  9
  7. 10  12  14  16  18  2   21  23  25  27  29  30  4   6  8
  8. [root@thinkpad 01]#
复制代码
为啥俩括号?

论坛徽章:
0
26 [报告]
发表于 2011-06-29 14:51 |只看该作者
回复 25# unixlinuxsys


   
Similar to the let command, the ((...)) construct permits arithmetic expansion and evaluation. In its simplest form, a=$(( 5 + 3 )) would set "a" to "5 + 3", or 8. However, this double parentheses construct is also a mechanism for allowing C-type manipulation of variables in Bash.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP