shell script help

General support questions
Post Reply
knzzz
Posts: 157
Joined: 2017/02/25 12:41:42

shell script help

Post by knzzz » 2019/06/05 13:01:13

Hi Team,

can some one please help me on how to get o/p in shell script

echo "{one, two, three}fish"

so that i need the op as
one fish ,two fish , three fish

Thraex
Posts: 51
Joined: 2019/05/14 19:50:28

Re: shell script help

Post by Thraex » 2019/06/05 14:15:34

This can be done with a loop: for i in {one,two,three}; do echo -n "$i fish "; done

If you want them on separate lines, remove the -n flag from echo

Post Reply