How to create list in shell using for loop

I am trying to create a new array using for loop

Images="alpine ubuntu centos"

Image_tags="$(for i in $Images; do

echo $Image_tags

I am expecting

Image_tags="r_madoori1/alpine r_madoori1/ubuntu r_madoori1/centos"

instead i am getting below error

./ line 7: r_madoori1/alpine: No such file or directory
./ line 7: r_madoori1/ubuntu: No such file or directory
./ line 7: r_madoori1/centos: No such file or directory

Read more here:

Content Attribution

This content was originally published by Rajeshwer wer at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: