title: BASH/LINUX - Problem with iterative sum in a loop (decimal numbers )
body: <p>I have a .csv file where I select the first column (variable "a") and later I change the dot (.) by comma (,), it is the variable "acomma".</p>
  
  <p>I am trying to sum all the values of this column with a loop (see code) but I always have the same mistake (see pic): </p>
  
  <p><strong>"syntax error: operand expected"</strong></p>
  
  <p>Curiusly the sum do it well (5129).</p>
  
  <p><a href="https://i.stack.imgur.com/0Y1Qg.png" rel="nofollow noreferrer">Code</a>:</p>
  
  <pre><code>while IFS=; read -r line;
  do
  a=$(echo $line | awk -F "\"*;\"*" '{print $1}')
  acomma=$(echo $a | sed 's/\./,/')
  let fixed_acidity=$(bc &lt;&lt;&lt; "scale=1; $fixed_acidity + $acomma")
  
  
  done &lt; winequality-white_sincabecera.csv
  
  echo $fixed_acidity
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FJC1n.png" rel="nofollow noreferrer">Output</a>:</p>
  
  <p><img src="https://i.stack.imgur.com/FJC1n.png" alt="Output"></p>
  
  <p>Can anyone help me with this? The aim is the sum of decimal in a iterative process.</p>