title: Can I get the real full executed command of Java Runtime.getRuntime().exec?
body: <p>When I tried to run <strong>Ansible</strong> with <code>Runtime.getRuntime().exec</code> with Java</p>
  
  <p>Here is what I did:</p>
  
  <pre><code>String[] cmd = {"ansible-playbook", "/path/to/playbook", "--extra-vars", "'{\"filePath\":\"/path/to/file\"}'"};
  Process process = Runtime.getRuntime().exec(cmd, null);
  </code></pre>
  
  <p>I got error message like this:</p>
  
  <pre><code>FAILED! =&gt; {"failed": true, "msg": "'filePath' is undefined"}
  </code></pre>
  
  <p>However when I executed the same command with terminal:</p>
  
  <pre><code>ansible-playbook /path/to/playbook --extra-vars '{"filePath":"/path/to/file"}'
  </code></pre>
  
  <p>Everything was fine...</p>
  
  <p>I think there must be some differences between the command I ran in terminal and Java, maybe apostrophe or quotation mark ?</p>
  
  <p>I'm wondering is there any way to get the real executed command of <code>Runtime.getRuntime().exec</code>?  Just like I can get command line history of some user by <code>history</code>...</p>