Monkless has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I once again come to you for the great wisdom you possess.
I am trying to execute an 'expect->send' command from my script through to the cluster ssh (CSSH) control window. However, even though debug shows expect sends the command to the proper spawn ID, the plain text is not sent, in this case is the password. Man CSSH does not show a password option, only an username option.
my $command = "cssh -G -T 'OOPCSSH' -l username $goto"; my $dl = Expect->new(); $dl->raw_pty(1); #$dl->log_stdout(0); $dl->spawn($command) or die "Cannot spawn $command: $! +\n"; #dl->expect(undef, "assword"); sleep 5; $dl->send("$passwd\r"); #$dl->expect(undef, "\$"); #$dl->send("$passwd\r"); #}
As you can see by the # I have tried several diff ways to send the command, the way currently configured, is the only way I get a successful send in DEBUG but still no password sent, login fails... Any ideas, would greatly ease the sound of my head hitting the wall..
Spawned 'Proc::Background=HASH(0x87abc5c)' spawn id(4) Pid: 17507 Tty: /dev/pts/12 at /usr/local/share/perl/5.8.8/Expect.pm line 181 Expect::spawn('Expect=GLOB(0x87abce0)', 'Proc::Background=HASH(0x8 +7abc5c)') called at ./Layout.pl line 453 main::go() called at /usr/local/lib/perl/5.8.8/Tk.pm line 247 eval {...} called at /usr/local/lib/perl/5.8.8/Tk.pm line 247 Tk::__ANON__('Tk::Button=HASH(0x877a450)') called at /usr/local/li +b/perl/5.8.8/Tk/Button.pm line 111 Tk::Button::butUp('Tk::Button=HASH(0x877a450)') called at /usr/loc +al/lib/perl/5.8.8/Tk.pm line 406 eval {...} called at /usr/local/lib/perl/5.8.8/Tk.pm line 406 Tk::MainLoop() called at ./Layout.pl line 427 SENDS PASSWD: Sending 'PassWD1\r' to spawn id(4) at /usr/local/share/perl/5.8.8/Expect.pm line 1264 Expect::print('Expect=GLOB(0x87abce0)', 'PassWD1\x{d}') called at +./Layout.pl line 456 main::go() called at /usr/local/lib/perl/5.8.8/Tk.pm line 247 eval {...} called at /usr/local/lib/perl/5.8.8/Tk.pm line 247 Tk::__ANON__('Tk::Button=HASH(0x877a450)') called at /usr/local/li +b/perl/5.8.8/Tk/Button.pm line 111 Tk::Button::butUp('Tk::Button=HASH(0x877a450)') called at /usr/loc +al/lib/perl/5.8.8/Tk.pm line 406 eval {...} called at /usr/local/lib/perl/5.8.8/Tk.pm line 406 Tk::MainLoop() called at ./Layout.pl line 427
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect and CSSH
by jffry (Hermit) on Feb 14, 2012 at 19:32 UTC | |
|
Re: Expect and CSSH
by salva (Canon) on Feb 15, 2012 at 08:36 UTC | |
by Monkless (Acolyte) on Feb 16, 2012 at 07:16 UTC | |
by Monkless (Acolyte) on Mar 06, 2012 at 09:04 UTC | |
|
Re: Expect and CSSH
by danlyke (Initiate) on Feb 14, 2012 at 23:16 UTC | |
by Monkless (Acolyte) on Feb 15, 2012 at 06:22 UTC |