shell for 循环演示
test.sh
#!/bin/bash for skill in Ada Coffe Action Java; do echo "I am good at ${skill}Script" done
输出
bogon:Desktop macname$ ./test.sh
I am good at AdaScript
I am good at CoffeScript
I am good at ActionScript
I am good at JavaScript
参考:
https://runoob.com/linux/linux-shell-variable.html