Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Net::OpenSSH changing directory does not work properly

by keszler (Priest)
on Dec 07, 2011 at 11:59 UTC ( #942230=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Net::OpenSSH changing directory does not work properly
in thread Net::OpenSSH changing directory does not work properly

Aha - I overlooked $ssh->open2pty. Thank you.

I agree that for a handful of serial-dependent commands the shell overhead is excessive, but at some point I believe it becomes worthwhile.


Comment on Re^3: Net::OpenSSH changing directory does not work properly
Download Code
Re^4: Net::OpenSSH changing directory does not work properly
by salva (Abbot) on Dec 07, 2011 at 12:09 UTC
    Actually, all the methods of Net::OpenSSH support running a shell, even if it doesn't make sense for several of them.

    Just, don't pass a command argument and you get a shell. For instance:

    $out = $ssh->capture({stdin_data => <<EOS}); ls foo this foo that rm -R / EOS # or... ($socket, $pid) = $ssh->open2socket; print $socket "ls\n"; while (<$socket>) { print }; waitpid($pid, 0);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-07-05 20:40 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 (68 votes), past polls