Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
62 views

When trying to match the "randomart" part of ssh-keygen's output using Expect, expect() finds an empty string after the "randomart", but not the expected eof, but I don't ...
U. Windl's user avatar
  • 4,794
1 vote
1 answer
85 views

Perl: attempting to access Expect object inside of Net::SSH::Expect gives an ERROR. Example pseudo code: my $m = Net::SSH::Expect->new( host => 192.168.1.6, user =&...
ZaPaDoS's user avatar
  • 13
1 vote
1 answer
66 views

I'm extremely new to Perl and struggling with something. Recently, another developer left my company, and my boss has asked me to fix a Perl script that my former colleague wrote but did not document....
Pete's user avatar
  • 1,599
1 vote
1 answer
259 views

I am passing an scp command in Expect->spawn($command), I am also passing the password or password + OTP based on a $object->expect(). Could you let me know if there is a way to determine if the ...
tourist's user avatar
  • 614
3 votes
1 answer
449 views

I'm very new to both Perl and expect and have been trying to figure out how to send a command when only the prompt appears. I know how to send a command after a certain output is displayed in the ...
MattieG4's user avatar
  • 188
1 vote
0 answers
224 views

When using Expect in Perl to automate ssh logins, if the 1st password fails, how can we try another password? It's not hard to find the pure Expect examples to do so but cannot find one for Expect in ...
Steve's user avatar
  • 367
0 votes
1 answer
72 views

I am using perl expect to enter password in an interactive program. Perl is outputting correct password but setting it something else. #!/bin/perl use Expect; my $hostname = qx! /usr/bin/hostname !;...
user746184's user avatar
1 vote
1 answer
348 views

I wanted to make the remote connection and automate the change password of any user account in that remote machine so I am using Perl Net::SSH:: Expect module. My connection is happening but I'm not ...
luffy008's user avatar
0 votes
1 answer
291 views

I am new to Perl. I am using Perl Expect module to automate a simple prog but the output is mismatched. This is my Perl code which I wanted to be automated #!/usr/bin/perl use 5.010; use strict; use ...
luffy008's user avatar
1 vote
0 answers
59 views

I'm trying to use Expect.pm on an old machine with perl 5.8.8. It works but when I send a text that contains a "#" sign it is removed from the text. Is there a way to escape/protect it? Thanks Sorry ...
user1708042's user avatar
  • 1,915
3 votes
1 answer
323 views

I'm trying to use expect to spawn a program in an automation script in perl. And I'm trying to decide how to wait on expect for this program to finish, since - I can't rely on any string matching ...
seek's user avatar
  • 51
0 votes
1 answer
374 views

I'm trying to understand the Expect Perl module. I want to take the value and the machine from $var, but I couldn't make my code work even if I used regular expressions. I want to take from $var the ...
Andrei Vieru's user avatar
0 votes
1 answer
174 views

I have show command for a device with its Mac address, which i am executing in perl using Expect.pm. The output of command is more than 100 line with --More-- at the bottom. I am able to capture ...
Kiran Kulkarni's user avatar
1 vote
0 answers
788 views

Have you found solution any on how to ssh using expect with threads? sub thDoWork { #variables my $thread_number = $_[0]; my $PassStoreQueue = $_[1]; my $Thread_Die = ''; my $...
Nicholas Wysocki's user avatar
-4 votes
1 answer
164 views

I never use perl script before. I have already done expect script, is there any way to convert it to perl? I am trying to learn perl script right now. Any idea could help! foreach addr $addr { if {$...
Terrence Guo's user avatar
4 votes
1 answer
608 views

I am working on a script which needs to spawn an Expect process periodically (every 5 mins) to do some work. Below is the code that I have that spawns an Expect process and does some work. The main ...
comatose's user avatar
  • 1,972
0 votes
1 answer
64 views

We have an interactive script(Script 1) which asks for an IP Address and continues it's execution process. Script 1 is called from script2. As we know the IP address we want to pass IP ...
Nagasai's user avatar
1 vote
0 answers
1k views

I have a big problem with special characters of Perl. I'm trying to establish a Telnet connection. So, after the command "Telnet $ipAddress" I have to send the credentials. I have done this way: ...
A. P.'s user avatar
  • 11
4 votes
1 answer
598 views

I'm trying to automate a login prompt in Perl I'm using SSHGetCredentials('login_prompt' => 1) to generate a login prompt which is a function of perl's Expect::SSH library This is how my code ...
Bad_Coder's user avatar
  • 1,039
0 votes
1 answer
2k views

I have to capture output of the send command when using Perl Expect module. I know that in shell or Tcl I can use puts $expect_out(buffer); to capture the previously run command. How can I do the ...
Bhushan Patil's user avatar
1 vote
1 answer
225 views

Let me ask the question with a specific set of example. The 1st code, nlines.pl is as follows: #!/usr/local/bin/perl ######################### # print Hello world n times with n entered by a prompt ##...
Manidip Sengupta's user avatar
5 votes
1 answer
197 views

This is example found in perldoc: $object->expect(15, '-re', "$str"); I want to add option 'i' to the match. This won't work: $object->expect(15, '-re', qr/$str/i); Do I have to ...
Jay Zhou's user avatar
0 votes
1 answer
544 views

I have an active ssh session created with Expect 1.15. In this session I execute the following commands for a second level of authentication. Unfortunately i have to use a strange password which ...
user3402702's user avatar
1 vote
1 answer
483 views

I'm using Expect to ssh. I want to know the Session ID of the spawned session. How do I do that? This is my code: my $addr = "10.101.10.102"; my $cmd = "ssh username@".$addr; my $exp = Expect->...
Randomly Named User's user avatar
0 votes
1 answer
252 views

I am using Expect.pm to connect with SSH to a remote server. While connected, I'm sending commands via the Expect object, and I receive answers from the remote server with it's control characters: ...
user116969's user avatar
3 votes
1 answer
1k views

I am trying to use perl to SSH in to a machine and issue a few commands... my $ssh = Net::SSH::Perl->new($host); $ssh->login($user,$pass); my($stdout, $sterr, $exit) = $ssh->cmd($cmd); print ...
Tom's user avatar
  • 332
2 votes
1 answer
311 views

A very simple code to connect to a server, run some commands, disconnect and run some more commands locally. #!/usr/bin/perl use strict; use warnings; use Expect; my $timeout = 15; my $password = "...
NPS's user avatar
  • 6,424
1 vote
1 answer
142 views

I have got this error when i try to connect to my switch ! use Net::OpenSSH; use warnings; use Expect; my $password = 'admin'; my $enable = ''; my $ip = '192.16.25.39'; my $username='user'; my $ssh = ...
ahmed's user avatar
  • 19
-1 votes
1 answer
411 views

For performance issue and duration optimization, i want to know who limits my number of SSH connections. A BASH script is calling X perl scripts. Each perl scripts spawn a new SSH connection towards ...
Gui O's user avatar
  • 383
1 vote
1 answer
558 views

I am new in Perl. I downloaded the library Net::SSH::Expect v.1.09 and tried to use it by example. When I try to execute a script I get the message: Bareword "exp_continue" not allowed while "...
matoo's user avatar
  • 11
2 votes
1 answer
859 views

I am using Expect module in Perl to do an interactive activity and execute a command on a remote machine. Request your help on this Here are the steps I used Do a switch user to another account. ...
Joseph's user avatar
  • 51