bash中for循环的一个特别写法
来源:互联网 发布:淘宝行业发展趋势 编辑:程序博客网 时间:2024/06/08 14:34
#!/bin/bash
# program: lists big planets
for planet in "Mercury 36" "Venus 67" "Earth 93" "Mars 142" "jupiter 483"
do
set -- $planet
echo "$1 $2,000,000 miles from the sun."
done
# program: lists big planets
for planet in "Mercury 36" "Venus 67" "Earth 93" "Mars 142" "jupiter 483"
do
set -- $planet
echo "$1 $2,000,000 miles from the sun."
done
这里“set -- $planet”重新指定了命令行参数。将planet的内容作为命令行参数。
而且这里planet是每个双引号括起来的字符串而不是像
for planet in "Mercury Venus Earth Mars Jupiter"
- bash中for循环的一个特别写法
- Java 中 for 循环的写法
- python中循环的写法 for
- for循环的写法
- for循环的写法
- For循环的拓展写法
- For 死循环的写法
- for循环特殊的写法
- java 1.5中for循环的新写法
- java 1.5中for循环的新写法
- java 1.5中for循环的新写法
- Shell中for循环的几个常用写法
- java中for循环的几种写法
- Java中List for循环的6种写法
- java中for循环的几种写法
- java中for循环的几种写法
- Shell中for循环的几个常用写法
- javascript中for循环的几种写法与总结
- 华为一道面试题,不能用系统的字符串函数求对等数,用最简单的方法实现。
- rsync服务器架设
- 静态成员函数
- ie6下CSS样式失效时如何进行调试
- LINQ to XML
- bash中for循环的一个特别写法
- 教你如何进行VMware 虚拟机优化
- Android情景模式、文件管理器 完整示例编程详解
- 游戏论(一)
- Oracle表与索引的分析及索引重建
- cygwin 编译 win32 程序 同时不依赖 cygwin1.dll
- 游戏论(二)
- 游戏论(三)
- MyBatis使用Generator自动生成代码