title: Execute Shell Script from python with arguments
body: <p>I want to execute a shell script with 3 arguments from a python script. (as described here: <a href="https://stackoverflow.com/questions/19325761/python-executing-shell-script-with-argumentsvariable-but-argument-is-not-rea">Python: executing shell script with arguments(variable), but argument is not read in shell script</a>)</p>
  
  <p>Here is my code:</p>
  
  <pre><code>subprocess.call('/root/bin/xen-limit %s %s %s' % (str(dom),str(result),str('--nosave'),), shell=True)
  </code></pre>
  
  <p>variables dom and result are containing strings.</p>
  
  <p>And here is the output:</p>
  
  <pre><code>/bin/sh: --nosave: not found
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>That is the variable "result":</p>
  
  <pre><code>c1 = ['/bin/cat', '/etc/xen/%s.cfg' % (str(dom))]
  p1 = subprocess.Popen(c1, stdout=subprocess.PIPE)
  
  c2 = ['grep', 'limited']
  p2 = subprocess.Popen(c2, stdin=p1.stdout, stdout=subprocess.PIPE)
  
  c3 = ['cut', '-d=', '-f2']
  p3 = subprocess.Popen(c3, stdin=p2.stdout, stdout=subprocess.PIPE)
  
  c4 = ['tr', '-d', '\"']
  p4 = subprocess.Popen(c4, stdin=p3.stdout, stdout=subprocess.PIPE)
  
  result = p4.stdout.read()
  </code></pre>
  
  <p>After that, the variable result is containing a number with mbit (for example 16mbit)</p>
  
  <p>And dom is a string like "myserver"</p>