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

 

posted @ 2019-08-23 22:58  anobscureretreat  阅读(228)  评论(0编辑  收藏  举报