[bash] make array put value in it (+change line)

ref(declare), ref(for,continued value for loop), ref(adding value, change line),  etc(1,2,3)

I would like to use this for make table for CMIP5.

It is very powerful and simple!!



declare -a array          # declaring array name as “array”

for var in {1..10};do    # organizing loop from 1 to 10 with “var”

array+=”$var \n”           # adding value of “var” into “array” and change line by “\n”


echo -e “${array}” > table  # writing array at new file

So, Simple 🙂