this article to introduce the Linux struggles shell in an array of relevant knowledge, and a lot of examples for reference, including an array of replication, computing, delete, replace, etc., is the rare good article to learn shell array.
${#array}
${#array [0]} #same as above. The ${#array [*]}, ${#array (@)}. Pay attention to the difference with #{array: 0}


the extraction of array

=array ([0]=one=two [1] [2]=three [3]=four)
${array (@) : 1} #two three, four, get rid of all the elements after the first element, then the ${array (@) : 0} said all elements
${array (@) : 0-2} #>
[root @ localhost dev] #echo ${array (@) : 0}
one, two three four
substring replace

[root @ localhost dev] #=array ([0]=one=two [1] [2]=three [3]=four)
the first match, deleted
[root @ localhost dev] #echo ${array/@/o/m}
mne the TWM three fmur


This concludes the body part