shell - keep expanding a bash variable -


imagine have n months, here n=3

i keep adding integer 1, 2, 3 shell variable called $test:

so when do

cat $test 

it return

1 2 3 

any idea?

just find solution:

for ((i=1;i<=3; i++));   test1="${i}"  test+="$test1 "  done 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -