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..



DEBUG OUTPUT:
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

In reply to Expect and CSSH by Monkless

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.