title: Bash/Perl chained SSH commands (A to B to C)
body: <p>I run a bash shell on machine A running via ssh a perl shell on machine B, requesting via ssh a command result to machine C. I can't get the result shown in tty on machine A...</p>
  
  <p>Here is a summary of several thousands of line codes :</p>
  
  <p><strong>1) bash shell "A" on machine "A": NOK</strong>  </p>
  
  <pre><code>...  
  ssh -p port userb@machineB "scriptB.pl"  
  ...  
  </code></pre>
  
  <p><strong>2) perl scriptB.pl" on machine "B": OK</strong>  </p>
  
  <pre><code>...  
  # my $user = qx|$ssh_cmd| if ($ssh_connection_ok);  
  my $user = qx#$ssh_cmd# if ($ssh_connection_ok);  
  ...  
  </code></pre>
  
  <p><strong>3) bash command $ssh_cmd on machine "C": OK</strong>  </p>
  
  <pre><code>cat /my_dir/my_file | grep this_user | head -n1 | cut -d: -f1 | tr  
  </code></pre>
  
  <p>Run as standalone, step2 and step3 are showing the expected result but running scriptB.pl from machine A does not return the expected data. I do not use Net::SSH2 at the moment but qx. Might be an issue in the client ssh setup.</p>
  
  <p>Thx in adv.</p>