title: How can I pass the result of a local `curl` in the command line to a remote server in one line?
body: <p>I'm looking to make something like the following work in a one-line shell.</p>
  
  <pre><code>curl -s icanhazip.com | ssh user@host 'php /path/to/script.php "[PASS_IP_HERE]"'
  </code></pre>
  
  <p>I need to pass my local IP to a remote server, preferably in one line.</p>
  
  <p>Today I do it like this:</p>
  
  <pre><code>curl -s icanhazip.com // manually copy result
  ssh user@host 'php /path/to/script.php "[PASTE_RESULT_HERE]"'
  </code></pre>
  
  <p>Assuming local IP is <code>1.2.3.4</code>, and remote IP is <code>5.6.7.8</code>, then the desired result is closer to:</p>
  
  <pre><code>&gt; curl -s icanhazip.com
  1.2.3.4
  &gt; ssh user@5.6.7.8 'php /path/to/script.php "1.2.3.4"'
  //          How can I pass this dynamically? ---^
  </code></pre>