title: How can i delete an element in an array and then shift the array in Shell Script?
body: <p>First let me state my problem clearly:  </p>
  
  <p>Ex: Let's pretend this is my array, (the elements don't matter as in my actual code they vary):</p>
  
  <pre><code>array=(jim 0 26 chris billy 78 hello foo bar)
  </code></pre>
  
  <p>Now say I want to remove the following elements: </p>
  
  <pre><code>chris 78 hello
  </code></pre>
  
  <p>So I did: <code>unset array[$i]</code> while looping through the array.
  This removes the elements correctly, however, i end up with an array that looks like this:</p>
  
  <pre><code>array=(jim 0 26 '' billy '' '' foo bar)
  </code></pre>
  
  <p>I need it to look like this:</p>
  
  <pre><code>array=(jim 0 26 billy foo bar)
  </code></pre>
  
  <p>where <em>jim</em> is at index <em>0</em>, <em>0@1</em>, <em>26@2</em>, etc..</p>
  
  <p>How do I delete the elements in the array and move the other elements so that there are no null/empty spaces in the array?</p>
  
  <p>Thanks!</p>