From: amit1017 <gos...@ho...> - 2007-11-02 13:12:42
|
Hi guys, I am new to perl and expect. I started putting a script together that telnets into desired devices one at a time and runs specified commands. Problem I have is, that the prompt on this hosts does not follow a certain norm. Some prompts are in caps, some are in lower caps. Normally, prompts are device names, but in some case our device names exceeds the number of characters allowed in the hostname, so it cuts of the exceeded letters. So having the following doesn't really work at times: $telnet->expect($timeout, "$HostName"); Is there anyway, I can do this. That once I spawn the telnet session and log in. The prompt that it gets, it stores it into a variable and than I can leverage that variable throughout my script wherever it expects a prompt. Also, these devices are all cisco devices. Is there a recommended timeout values? I have $telnet->exp_internal(1) in my script. So In middle of the output after a command is run, I see several /r's. Thanks in advance for your help. Amit. -- View this message in context: http://www.nabble.com/Having-problems-with-prompt-tf4737304.html#a13547267 Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |