title: Shell script, saving the command value to a variable
body: <p>I am trying to print the value of <code>VARI</code> in the same line followed by a comma, so that i can have a csv file of these values, but i m not able to save the value of 
   <code>VARI = 'cat filename | head -1 | cut -d, -f${i}'</code></p>
  
  <pre><code>i=0
  while (( i&lt;130)) ;
  do
    if [[ $i -eq 1 ||  $i -eq 9 || $i -eq 12 || $i -eq 23 || $i -eq 25 || $i -eq 29 ]]
    then
      VARI = 'cat filename | head -1 | cut -d, -f${i}'
      echo  "$VARI ,"   
    fi
    let i=$i+1;
  done
  </code></pre>
  
  <p>output expected is </p>
  
  <pre><code>4,abc,5,8,xyz,9
  </code></pre>
  
  <p>Please let me know what i am doing wrong, thanks!</p>