title: how to pass command-line arguments to a program run with the open command?
body: <p>Is there a way to pass arguments to a program being run via:</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app ~/my_executable
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app ~/my_executable arg1 arg2
  </code></pre>
  
  <p>But this is interpreted as telling the terminal to open <code>~/my_executable ~/arg1 ~/arg2.</code></p>
  
  <p>I have tried:</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app '~/my_executable arg1 arg2'
  </code></pre>
  
  <p>But it picks up arg1 and arg2 as if they were part of the path rather than arguments.</p>
  
  <p>I have tried:</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app ~/my_executable | xargs arg1 arg2
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app ~/my_executable --args arg1 arg2
  </code></pre>
  
  <p>But with that flag, args are passed to the terminal.</p>
  
  <h2>NOTE</h2>
  
  <p>I am only allowed to change the arguments to Terminal.app (the part within [ ]):</p>
  
  <pre><code>open -a /Applications/Utilities/Terminal.app [~/my_executable arg1 arg2]
  </code></pre>