title: bash printing and incrementing array values
body: <p>I'm making a bash script in which I need to print a number while it's incremented like this:</p>
  
  <pre><code>0000
  0001
  0002
  0003
  0004
  </code></pre>
  
  <p>I have made this but is not working:</p>
  
  <pre><code>#!/bin/bash
  i=0
  pass[0]=0
  pass[1]=0
  pass[2]=0
  pass[3]=0
  for i in $(seq 1 9)
      pass[3]="$i"
      echo ${pass[*]}
  done
  </code></pre>
  
  <p>I paste the script on cli and i get this.</p>
  
  <pre><code>$ ~ #!/bin/bash
  $ ~ i=0
  $ ~ pass[0]=0
  $ ~ pass[1]=0
  $ ~ pass[2]=0
  $ ~ pass[3]=0
  $ ~ for i in $(seq 1 9)
  &gt;     pass[3]="$i"
  bash: error sintáctico cerca del elemento inesperado `pass[3]="$i"'
  $ ~     echo ${pass[*]}
  0 0 0 0
  $ ~ done
  bash: error sintáctico cerca del elemento inesperado `done'
  $ ~ 
  </code></pre>