shell--循环语句2021-09-12, updated 2021-09-20for语句顺序输出当前列表中的数字:1 2 3 4 for loop in 1 2 3 4 5 do echo "The value is: $loop" done 输出结果1 2 3 4 5 The value is: 1 The value is: 2 The value is: 3 The value is: 4 The value is: 5 顺序输出字符串中的字符:1 2 3 4 5 6 #!/bin/bash for str in This is a string do echo $str done 输出结果1 2 3 4 This is a string