title: why bash throws unbound variable warning when I declare a local array in function whose name is shadowing a global one?
body: <p>In this example declaring local variable with different name from that of global scope produces no error but when name is the same as global I get:</p>
  
  <p><code>line 5: !1: unbound variable</code></p>
  
  <p>code: </p>
  
  <pre><code>set -u
  function get_arr {
    local myArr2=("${!1}")
    echo ${myArr2[*]}
    local myArr=("${!1}")
    echo ${myArr[*]}
  }
  
  myArr=(one two three)
  get_arr myArr[@]
  </code></pre>