If you have bash version 3.2 or later, you can do this using the new syntax "subitem" ( ${bigArray[@]:index_of_first_element:element_count} ), but be careful - if the element values have any spaces in them, it can be terrible preprocessing.
So the idea goes line by line:
cnt="${#bigArray[@]}" let cnt1="$cnt/2" let cnt2="$cnt - $cnt1 - 1"
source share