title: How to replace variable name in files using bash script?
body: <p>I have a file with cpp code named model_c2.cpp.
  One of the line in code is: </p>
  
  <pre><code>double n=0.0;
  </code></pre>
  
  <p>I want to use bash and sed to loop it through from 1.0 to 50.0.
  I tried the following loop but it isn't working. What I am doing wrong?</p>
  
  <pre><code>#!/bin/bash
  
  for i in $(seq 1 50);
  do
      sed -i -e 's/n=*/n=$i.0/g' $model_c2.cpp    
  done
  </code></pre>