Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Urgent Help For Perl Issues

by arvindninestars (Initiate)
on Mar 15, 2013 at 08:23 UTC ( #1023639=note: print w/ replies, xml ) Need Help??


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

Hi Vinoth, Great its working fine. But one thing if i login into server its landing into default path.But if i need to untar into different path after landing, what can i do? Example : My landing path /home/systems after that need to change "testing" directory and untar. Please help!!!!


Comment on Re^2: Urgent Help For Perl Issues
Re^3: Urgent Help For Perl Issues
by vinoth.ree (Parson) on Mar 15, 2013 at 08:36 UTC

    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");
      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....

        As suggested by marto just print

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

        after

        my($stdout, $stderr, $exit) = $ssh->cmd("cd testing");
Re^3: Urgent Help For Perl Issues
by marto (Bishop) on Mar 15, 2013 at 09:05 UTC

    If you choose to use this familiarise yourself with ssh, and the Net::SSH::Perl documentation, the README shows you where sample/tutorial scripts live within the distribution.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-12-27 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls