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....

Replies are listed 'Best First'.
Re^5: Urgent Help For Perl Issues
by marto (Cardinal) on Mar 15, 2013 at 09:47 UTC
Re^5: Urgent Help For Perl Issues
by vinoth.ree (Monsignor) 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..
          A reply falls below the community's threshold of quality. You may see it by logging in.
      Showing Empty Values Only Marto..No Luck