in reply to Re: Re: Changing passwords using Expect.pm through ssh on a large number (75) of systems
in thread Changing passwords using Expect.pm through ssh on a large number (75) of systems

Sorry, overlooked:
$exp->send("$_send\n");
If it's not sent explicitly, Expect doesn't add a return onto the end of the string you're sending. Also, are you sure you want to be matching $username\n? I'm guessing the \n is a typo, somehow...

I took out the pattern-match statement looking for the ssh password (I'm using keys) and tried the script, and it works for me. Let me know if you're still having trouble...

scott.
  • Comment on Re: Re: Re: Changing passwords using Expect.pm through ssh on a large number (75) of systems
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Changing passwords using Expect.pm through ssh on a large number (75) of systems
by linebacker (Scribe) on Jul 12, 2002 at 02:36 UTC
    Thanks,
    $username\n? was a mistake by me

    I just wanted to mention that I had to use
    $exp->send( "$_send\r" );
    for the script to fire properly. I had been reading the perldoc's on the Expect.pm module as well as the 2 pages in the Perl Cookbook. I will add a Net::Ping and Mail::Mailer to the program next (for error checking / availability) as well as reporting. Will post to CUFP when its done. Thanks again sschneid.