title: Copy file with os.system
body: <p>I have several files named as follow <code>a_b.nc</code> <code>a_c.nc</code> <code>a_d.nc</code>.
  I would like to copy/rename those files using a loop.</p>
  
  <p>I tried using the following code:</p>
  
  <pre><code>import os
  stations = ["b" , "c" , "d"]
  inbasedir = "/home/david/test_pals/PALS/sites_lai/"
  varname = "a_"
  for station in stations:
      os.chdir(inbasedir)
      os.system("cp ${varname}${station}.nc ${varname}${station}_lai.nc")
  </code></pre>
  
  <p>The code produces no error, but at the same time it produces no output at all :)</p>
  
  <p>Does anyone has an idea about how to produce the desired output? </p>