Thomas Jason
Thomas Jason

Reputation: 568

How to make shell for git clone using for loop

I want to make git clone with for loop. So I made a shell as below.

mss=("company","fruit","car")

for ms in "${mss[@]}" ; do
        git clone https://github.com/test/$ms
        yarn // to install node_module of each repository
done

But when I run this shell, it doesn't work at all.

Upvotes: 1

Views: 982

Answers (1)

Mureinik
Mureinik

Reputation: 311843

Shell arrays don't have commas in them - the elements are separated by whitespace:

mss=("company" "fruit" "car")

Upvotes: 2

Related Questions