免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2254 | 回复: 7
打印 上一主题 下一主题

关于函数中循环语句的用法 [复制链接]

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-03 12:00 |只看该作者 |倒序浏览
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
2 [报告]
发表于 2008-11-03 12:06 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
3 [报告]
发表于 2008-11-03 12:14 |只看该作者
$@代表所有的参数,她们都是分开的
$0是脚本的名字
`command`之间的command是个命令

论坛徽章:
0
4 [报告]
发表于 2008-11-03 12:17 |只看该作者
看看13问吧

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
5 [报告]
发表于 2008-11-03 12:23 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
6 [报告]
发表于 2008-11-03 12:29 |只看该作者
$man bash

  1. for name [ in word ] ; do list ; done
  2.               The list of words following in is expanded, generating a list of
  3.               items.  The variable name is set to each element of this list in
  4.               turn, and list is executed each time.  If the in word  is        omit-
  5.               ted,  the        for  command  executes        list once for each positional
  6.               parameter that is set (see PARAMETERS below).  The return status
  7.               is  the  exit  status of the last command that executes.        If the
  8.               expansion of the items following in results in an empty list, no
  9.               commands are executed, and the return status is 0.
复制代码

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
7 [报告]
发表于 2008-11-03 12:55 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
8 [报告]
发表于 2008-11-03 16:32 |只看该作者
执行脚本时输入的参数就是LOOP的取值范围。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP