Bash: Can an array hold the name of another array? -


I am writing a program and trying to break the data, which is stored in an array so that it is fast To run from I am trying to go about this way:

  data_to_analyze = (1 2 3 4 5 6 7 8 9 10) #original array size dataSize = ($ {# data_to_analyze [ @]}) That's the #half of size samSmall = "$ dataSize / 2" #the second half of the name samSmall2 = ("$ dataSize - $ samSmall -1") #the first half smallArray = ("$ {data_to_analyze [@} : 0: $ samSmall} "#the rest smallArray2 = (" $ {data_to_analyze [@]: $ samSmall: $ samSmall2} ") name #an array (which corresponds to arrays) combArray = (smallArray smallArray2) sizeComb = ( $ {# CombArray [@]}) Length of new array for # ((i = 0; i & lt; = $ sizeComb; i ++)); # Back from the first set of data, and then return the loop back to the other array data? $ {Coggrare [I]} for sample_name; Command wait command waited   

I think it first gives only the first array of data for the loop when the first array is complete, then with the other array set Should go again.

Does it leave me with two questions that the comb diagram is actually passing two small arrays? And is there any better way?

  #! / Bin / bash data_to_analyze = (1 2 3 4 5 6 7 8 9 10) dataSize = $ {# data_to_analyze [@}} ((samSmall = dataSize / 2, samSmall2 = dataSize-samSmall)) smallArray = ("$ {data_to_analyze [@]: 0: $ samSmall} ") smallArray2 = (" $ {data_to_analyze [@]: $ samSmall: $ samSmall2} ") CombArray = (smallArray smallArray2) for sizeComb = $ {# combArray [@]} ( I = 0; i & lt; $ sizeComb; i ++)); Evalize 'one = "$ {' $ {combArray [i]} '[@]}") for sample_name in "$ {A [@}}" ... done ... done ...   

Edit: Deleted double quotes by $ {combArray [i]}, and & lt; = & Amp; & Lt; For

Comments