shell中的for,while及until循环

for循环 for循环会遍历值列表,只要还在其范围内,就会一直执行循环体内的内容,直至遍历完成,所以for循环适合用于已知循环次数的情况 用法: for var in list do commands done 例1:遍历数字 #!/bin/bash for test in 1 2 3 4 5 6 7 8 9 10 do echo The next number is $test don
相关文章
相关标签/搜索