title: How to use xargs with cross platform commands
body: <p>I want to generate a one-liner in bash that has the following structure:</p>
  
  <pre><code>generate-url.sh | xargs `cross-platform-open`
  </code></pre>
  
  <p>where <code>cross-platform-open</code> should be a one-liner that either runs <code>xdg-open</code> or <code>open</code> depending on the platform.</p>
  
  <p>I was able to run run this cross platform command by using the line</p>
  
  <pre><code>if [ `uname` == "Linux" ] ; then `xdg-open` ; else `open` ; fi
  </code></pre>
  
  <p>and it works fine for my purposes. However, when I want to throw this into the above line, bash starts complaining (obviously because the inner grave accent (`) characters are breaking the execution block of the outer ones). I tried using <code>eval</code> instead but with no luck. Could somebody please help me with this issue?</p>