Shell for loop demo

test.sh

#!/bin/bash

for skill in Ada Coffe Action Java; do
echo
"I am good at ${skill}Script"
done

Output

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

Reference:

https:/ /runoob.com/linux/linux-shell-variable.html

#!/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

Leave a Comment

Your email address will not be published.