3 Comments

  1. But, what if you want to remotely run many more commands, if statements, while loops, etc., and make it all readable?

    1. The bash method can works well for this. On one node, you can run a set of bash code from STDIN like

      echo 'for i in {1..8}; do echo $i; done;' | ssh node1 'bash -s'
      

      Here, the `bash -s` executes command from STDIN which is passed through the SSH tunnel.

Leave a Reply

Your email address will not be published. Required fields are marked *