title: How to execute awk command inside python
body: <p>I am trying to run the following <code>awk</code> command inside python but I get a syntax error related to the quotes:</p>
  
  <pre><code>import subprocess
  COMMAND = "df /dev/sda1 | awk /'NR==2 {sub("%","",$5); if ($5 &gt;= 80) {printf "Warning! Space usage is %d%%", $5}}"
  
  subprocess.call(COMMAND, shell=True)
  </code></pre>
  
  <p>I tried to escape the quotes but I am still getting the same error.</p>