title: Looping over a Bash array: getting the next element in the middle of the loop
body: <p>Searching an array (lines_ary[@]) which has read a file into it, I'm trying to find a version number in the text. Here I am looking for Release, so I can find the version number that follows.</p>
  
  <p>Is there any way to access the next element in an array in a bash script when doing the following loop?</p>
  
  <pre><code>for i in ${lines_ary[@]}; do
   if [ $i == "Release:" ] ; then
    echo ${i+1}
   fi
  done
  </code></pre>
  
  <p>This just prints out '1', rather than say '4.4'.</p>