cadenwu的博客cadenwu.blog.chinaunix.net
lvdbing
全部博文(43)
2011年(5)
2010年(12)
2009年(6)
2008年(20)
xy1121
wangxinm
zkstuden
ranson_z
yxcwf
linuxboy
ToDDY
大鬼不动
itsec200
guoyan11
smile124
yepyang
gaokeke1
linux_yg
蜀黍cm
wangzb19
Otokaze
滑稽A神
分类:
2010-06-30 00:24:22
cadenwu@cadenwu-laptop:~/Templates/Bash$ cat loop1.sh #!/bin/bash # SYNOPSIS # seq [OPTION]... LAST # seq [OPTION]... FIRST LAST # seq [OPTION]... FIRST INCREMENT LAST # usage: seq LAST echo "usage: seq LAST" for i in $(seq 3) do echo "$i" done echo # usage: seq FIRST LAST echo "usage: seq FIRST LAST" for i in $(seq 2 5) do echo "$i" done echo # usage: seq FIRST INCREMENT LAST echo "usage: seq FIRST INCREMENT LAST" for i in $(seq 4 2 10) do echo "$i" done echo
cadenwu@cadenwu-laptop:~/Templates/Bash$ ./loop1.sh usage: seq LAST 1 2 3 usage: seq FIRST LAST 2 3 4 5 usage: seq FIRST INCREMENT LAST 4 6 8 10
cadenwu@cadenwu-laptop:~/Templates/Bash$ cat loop2.sh #!/bin/bash for ((i=3; i<=7; i++)) do echo "$i" done
cadenwu@cadenwu-laptop:~/Templates/Bash$ ./loop2.sh 3 4 5 6 7
cadenwu@cadenwu-laptop:~/Templates/Bash$ cat loop3.sh #!/bin/bash for i in {1..5} do echo $i done cadenwu@cadenwu-laptop:~/Templates/Bash$ ./loop3.sh 1 2 3 4 5
上一篇:修改乱码文件名的文件
下一篇:installing Code::Blocks for debian
登录 注册