shell的while/for脚本的简单入门
while [condition]
do
done
关键字break跳出循环,continue跳过循环的余下部分。
for var in ...;do
...
done
示例:
#!/bin/bash for var in A B C;do echo "var is $var" done
while [condition]
do
done
关键字break跳出循环,continue跳过循环的余下部分。
for var in ...;do
...
done
示例:
#!/bin/bash for var in A B C;do echo "var is $var" done