Hi, I have lots of unix machines to change the password on the root account, the following code I have put together only goes so far. Looking at the messages file I can see the perl script log into the system, and execute the passwd program, however it just times out after that...... I appears that the password program is waiting for input but doesn't want to hit the next line. I was expecting a time out on pattern match if anything..I have tried a few variations with no luck. I have this is enough to troubleshoot with. Can anybody shed some light on this? :)
Thanks in advance, -s. =================== the output: C:\>t.pl just about to send passwd command.... command timed-out at C:\t.pl line 10 =============================== the script: use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Prompt => '/\$ $/i'); $telnet->open('davros'); $telnet->login('root', 'mypasswd'); print "just about to send passwd command....\n"; # execute password command print $telnet->cmd('passwd'); print "executed passwd"; # wait for the first password prompt $telnet->waitfor('/password:.* $/i'); print "executed waiting for word:\n"; # type in the new password # print $telnet->cmd('newpass'); $telnet->print('newpass'); print "executed sent first password\n"; # wait for the second password prompt $telnet->waitfor('/password:.* $/i'); print "executed waiting for word again\n"; # confirm the new password # print $telnet->cmd('newpass'); $telnet->print('newpass'); print "executed confirmed entering new password\n"; $telnet->close; -- _______________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Have you downloaded the latest calling software from Net2Phone? Click here to get it now! http://www.net2phone.com/cgi-bin/link.cgi?157 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]