Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^3: Urgent Help For Perl Issues

by vinoth.ree (Monsignor)
on Mar 15, 2013 at 08:36 UTC ( #1023640=note: print w/replies, xml ) Need Help??

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

Just use the cd command with your path and navigate to your path and do untar

my($stdout, $stderr, $exit) = $ssh->cmd("cd $path"); ($stdout, $stderr, $exit) = $ssh->cmd("untar tar.gz");

Replies are listed 'Best First'.
Re^4: Urgent Help For Perl Issues
by Anonymous Monk on Mar 15, 2013 at 09:31 UTC
    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");
    This one i used. But file unzipped in home directory only not unzipped inside testing folder.. Any Worng....

      As suggested by marto just print

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


      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")
        Showing Empty Values Only Marto..No Luck

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023640]
[ambrus]: Because that could break AnyEvent code, which is why I added a guard.
[ambrus]: (It might be easier to use the callback scalar as a guard, as in $c and &$c(); $c = ();)
[Corion]: ambrus: Hurr - yes, that might happen, as Prima will queue lots of stuff (Well, Windows will)
[Corion]: But I'm really amazed that it just took this little code (plus the idle handler I have in mind and something else dk suggested)
[Corion]: ambrus: I wrote the handler so that it stops the timer if it's supposed to be a one-shot
[Discipulus]: are you using Prima Corion? good morning Corion and ambrus, btw

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2016-12-09 09:03 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (150 votes). Check out past polls.