Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Urgent Help For Perl Issues

by Anonymous Monk
on Mar 15, 2013 at 09:31 UTC ( #1023651=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Urgent Help For Perl Issues
in thread Urgent Help For Perl Issues

Hi Vinoth,

my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $password); my($stdout, $stderr, $exit) = $ssh->cmd("cd testing"); ($stdout, $stderr, $exit) = $ssh->cmd("unzip wwww.zip");
This one i used. But file unzipped in home directory only not unzipped inside testing folder.. Any Worng....


Comment on Re^4: Urgent Help For Perl Issues
Download Code
Re^5: Urgent Help For Perl Issues
by marto (Bishop) on Mar 15, 2013 at 09:47 UTC
Re^5: Urgent Help For Perl Issues
by vinoth.ree (Prior) on Mar 15, 2013 at 10:17 UTC

    As suggested by marto just print

    print "$stdout\n"; print "$stderr\n"; print "$exit\n";

    after

    my($stdout, $stderr, $exit) = $ssh->cmd("cd testing");
      ssh opens a new session for every command run and so commands with side effects as cd doesn't work as expected.

      Use shell conjunctions instead to run the two commands as one:

      $ssh->cmd("cd $dir && $cmd")
        No Luck salva..Any Other ideas..
      Showing Empty Values Only Marto..No Luck

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023651]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (19)
As of 2015-07-06 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls