title: python command substitution for linux commands
body: <p>I am trying to use command substitution for building a linux command from a python script, but am not able to get the following simple example to work:</p>
  
  <pre><code>LS="/bin/ls -l"
  FILENAME="inventory.txt"
  
  cmd = "_LS _FILENAME "
  ps= subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
  output = ps.communicate()[0]
  print output
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>JB</p>