title: How to change values of bash array elements without loop
body: <pre><code>array=(a b c d)
  </code></pre>
  
  <p>I would like to add a character before each element of the array in order to have this</p>
  
  <pre><code>array=(^a ^b ^c ^d)
  </code></pre>
  
  <p>An easy way to do that is to loop on array elements and change values one by one</p>
  
  <pre><code>for i in "${#array[@]}"
  do
      array[i]="^"array[i]
  done
  </code></pre>
  
  <p>But I would like to know if there is any way to do the same thing without looping on the array as I have to do the same instruction on all elements.</p>
  
  <p>Thanks in advance.</p>