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

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/11403080.html