Hello GURU's it has been awhile that I have needed such great direction, but my current issue has me stumped.

I am looking to use Net::SSH::Perl to remote into host and run a wget command to download a package on the remote host in question. I can seem to get all my commands to run on the remote host, but WGET seems to fail:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Net::SSH::Perl; my $host = '192.168.x.x'; my $user = 'user'; my $pw = 'pass'; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pw); ## THIS SECTION FAILS ## $ssh->cmd("cd /var/tmp"); $ssh->cmd("wget -c -np -r -nH --cut-dirs=1 --reject \"index.html*\" ht +tp://myURL.com/patch/126546-07/"); ########################

If I run the following, it completes as expected:

 $ssh->cmd("cd /var/tmp; hostname > host.dat");

If I try the same with ; seperated WGET calls, nothing seems to happen

 $ssh->cmd("cd /var/tmp; wget -c -np -r -nH --cut-dirs=1 --reject \"index.html*\" http://myURL.com/patch/126546-07/");

The above shows NOTHING in /var/tmp - though I would expect my downloaded DIR to be there.. I have ran the WGET call on host in question to ensure it supports the WGET package and all works well....

Desired output, would be the script changes to the '/var/tmp' DIR on remote host, then completes the package download in /var/tmp so I then can act on the newly downloaded package.


In reply to Net::SSH::Perl and WGET by Monkless

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.