title: How can I send multiple commands to Interactive telnet/ssh session from command line?
body: <p>I have a problem with one of the tasks I'm working on at the moment. I have to execute 2 commands in the interactive telnet/ssh session from the level of command line. </p>
  
  <p>I have managed to login to the server using plink command line, but then the difficult part comes, I have no idea how to pass 2 commands to it and end the session. </p>
  
  <p>Normally I do it in PuTTY by loading a session, then typing in: </p>
  
  <pre><code>53 <kbd>Enter</kbd>
  GIVE 5 next 3 <kbd>Enter</kbd></code></pre>
  
  <p>and here I close the PuTTY window.</p>
  
  <p>I want to automate it, but I fail to pass the commands that should be executed into <code>plink</code>. Maybe I should have used other tool, but I'm running out of ideas on how to do it.</p>