- 论坛徽章:
- 0
|
原帖由 linux飞翔 于 2008-4-24 15:48 发表 ![]()
楼上的老大,不是我说你,你水平很高吗,我现在求救,你说for不行,我就换if,按你说的还不行?
再说for也行
這位朋友您似乎不大客氣哦.... 不都提供 for 正確用法嗎,再者這些東西不是應該先自己看一下 manpage or google 一下就知道答案呼?
- $help
- for: for NAME [in WORDS ... ;] do COMMANDS; done
- The `for' loop executes a sequence of commands for each member in a
- list of items. If `in WORDS ...;' is not present, then `in "$@"' is
- assumed. For each element in WORDS, NAME is set to that element, and
- the COMMANDS are executed.
- for ((: for (( exp1; exp2; exp3 )); do COMMANDS; done
- Equivalent to
- (( EXP1 ))
- while (( EXP2 )); do
- COMMANDS
- (( EXP3 ))
- done
- EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is
- omitted, it behaves as if it evaluates to 1.
复制代码
若您真的不大會用,請看一下基本教程也可以,比方 Bash Programming Intro HOWTO
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
-- |
|