title: Pipe two files to bash, and run remotely via ssh
body: <p>I want to send two files to bash and run remotely via ssh. I have the following snippet:</p>
  
  <pre><code>#!/bin/bash
  echo "Logging in..."
  ssh -i ~/.ssh/my.pem user@x.x.x.x -T "bash -l" &lt; ${MY_HOME}/check.sh
  </code></pre>
  
  <p>which works, but I have some variables in another I would like to make available inside check.sh remotely. Here's what I want in a broken way:</p>
  
  <pre><code>#!/bin/bash
  echo "Logging in..."
  ssh -i ~/.ssh/my.pem user@x.x.x.x -T "bash -l" &lt; (${MY_HOME}/vars.sh &lt; ${MY_HOME}/check.sh)
  </code></pre>
  
  <p>Is there any way to accomplish this? The above doesn't work at all.</p>