title: From Windows, use Expect and plink to execute standard commands on remote Linux machine
body: <p>I want to connect to a distant Linux machine trough ssh (with primary key and passphrase) and execute commands on that remote machine. The goal is to make some recurrent tasks faster.</p>
  
  <p>I use plink (putty link) to connect with SSH and TCL (with Expect installed) to send commands to my linux server.
  But nothing works! When I execute the following script, nothing happens. Not an error, not a line, nothing. Just the word "begin" until the timeout expires.
  But if I write "plink sessionName" in the console directly I have the response of the linux server, I can enter my passphrase and control the remote machine.</p>
  
  <pre><code>package require Expect
  
  exp_send "begin\n"
  exp_spawn plink sessionName
  exp_send "end\n"
  expect "Using username \root\".\nPassphrase for key \"imported-openssh-key\": "
  </code></pre>
  
  <p>Thank you in advance for helping me :)</p>