There's much, much better ways to do this, "expect" is just a third-party hack which tackles a few special cases that positively can't be handled any other way.
In a shell I would do
or
In Perl you can just dump those raw into system(), which of course will wait, but you can
I see and understand the concept to an extent, but it doesn't look like this code can assign the output of the commands to variable within my perl script. If this is not the case, please explain.
Hey guys
I am trying to send a perl -e command to a number of systems using SSH. The command should retrieve some information for me. The problem is, the remote shell tries to interpolate my variables and doesn't get it should take the command literally and just execute it.
Below the code.... (2 Replies)
Note: Not a programmer by profession but occasionally have to program.
I am looking for general methods and freely/readily available tools employed to debug problems during development of perl scripts. Anything that has really helped you out with problems you just couldn't find.
A couple of... (5 Replies)
What is the difference between these yum provides and whatprovides methods? I know provides and whatprovides give the same results, but different methods of */ and \* give different results. Also whether you put */ and \* in front of the string or behind the string give different results. I have... (0 Replies)
I have recently completed Solaris 10 System Administration book by Bill Calkins. Now I want to learn more about UNIX. I have tried to research online but there is too much information and I am sort of overwhelmed and don't know where to start. Can anybody give some idea on how to pursue my learning... (3 Replies)
I'm trying to create a perl script that will do 1 SSH session, but be able to write multiple commands to the session and receive multiple outputs. I know there are modules out there like Net:SSH::Perl, but I'm not allowed to use it. I was thinking of doing something like an open3 on an ssh... (4 Replies)
Hello
I am on my way to improve my wonderful Perl skills, I got an issue which I want to share with you all. I have a Perl module which looks like
package Cocoa;
require Exporter;
@ISA = qw(Exporter);
my $a='';
my $b='';
my $c='';
sub new {
my $this = shift; # Create... (8 Replies)
Hi all,
I am looking to encrypt a filesystem with a CentOS 6.4 install.
However I note that when using LUKS the system does not boot without prompting for the password encryption key.
I am looking for an drive/filesystem encryption solution which will allow reboots and shutdown/starts of the... (4 Replies)
Hi Folks,
Would like to understand if there exists any method to write the logs for LDAP authenticated users and Local Users separately in two different files.
If not, then do I distinguish whether the user is LDAP or local without looking at passwd.
Bye the way, I am trying this weird... (0 Replies)
I've been troubleshooting a ksh93 script I wrote today and have narrowed it down to the root cause. but I don't understand why?
so, i've written the following script to demonstrate the problem i found today:
#!/bin/ksh
method=$1
FILE_LIST=( $(find /someplace -type f -printf... (10 Replies)
Discussion started by: BLinux
10 Replies
LEARN ABOUT DEBIAN
net::openssh::compat
Net::OpenSSH::Compat(3pm) User Contributed Perl Documentation Net::OpenSSH::Compat(3pm)NAME
Net::OpenSSH::Compat - Compatibility modules for Net::OpenSSH
SYNOPSIS
use Net::OpenSSH::Compat 'Net::SSH2';
use Net::OpenSSH::Compat 'Net::SSH::Perl';
DESCRIPTION
This package contains a set of adapter modules that run on top of Net::OpenSSH providing the APIs of other SSH modules available from CPAN.
Currently, there are adapters available for Net::SSH2 and Net::SSH::Perl. Adapters for Net::SSH and Net::SFTP are planned... maybe also for
Net::SCP and Net::SCP::Expect if somebody request them.
BUGS AND SUPPORT
This is a work in progress.
If you find any bug fill a report at the CPAN RT bugtracker (https://rt.cpan.org/Ticket/Create.html?Queue=Net-OpenSSH-Compat
<https://rt.cpan.org/Ticket/Create.html?Queue=Net-OpenSSH-Compat>) or just send me an e-mail with the details.
Git repository
The source code repository is at https://github.com/salva/p5-Net-OpenSSH-Compat <https://github.com/salva/p5-Net-OpenSSH-Compat>.
My wishlist
If you like this module and you're feeling generous, take a look at my Amazon Wish List: <http://amzn.com/w/1WU1P6IR5QZ42>
Also consider contributing to the OpenSSH project this module builds upon: <http://www.openssh.org/donations.html>.
SEE ALSO
Net::OpenSSH, Net::OpenSSH::Compat::SSH2, Net::OpenSSH::Compat::Perl.
COPYRIGHT AND LICENSE
Copyright (C) 2011 by Salvador Fandino (sfandino@yahoo.com)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.
perl v5.14.2 2011-09-28 Net::OpenSSH::Compat(3pm)