title: Execute Remote Perl Script on a Windows Box from a Linux Box
body: <p>We recently got SSH setup on our Windows boxes so we could eliminate the need for disc mounts on our Linux machines. We are using Pentaho and I am writing a shell script that will, from a Linux box, SSH into the Windows box and execute a perl script. </p>
  
  <p>I have able to write in a way to SSH into the windows box and switch to the directory that holds the Perl scripts that I need to execute, I just can't figure out how to actually execute them.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>#!/bin/sh
  ssh -t xxxxx@xxxxx "cd /path/to/script/ /path/to/perl.exe HelloWorld.pl"
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>#!/bin/sh
  ssh -t xxxxx@xxxxx "cd /path/to/directory/with/perl/script" \
                     "/path/to/perl.exe HelloWorld.pl"
  </code></pre>
  
  <p>Both attempts result in a short delay and then a "disconnected from xxxxx" and the perl does not run. I can do all of these steps manually through a shell, but can't seem to get them working in script form. As a note, the only way I've been able to execute the perl scripts is if have the shell <b>in</b> the directory the perl script is in.</p>