go ahead... be a heretic | |
PerlMonks |
Re: Telnet Command Prompt Helpby Gilimanjaro (Hermit) |
on Jan 29, 2003 at 16:15 UTC ( [id://230990]=note: print w/replies, xml ) | Need Help?? |
Using telnet is usually a bad idea, unless you yourself are sitting behind the keyboard; that's what it was designed for. Update: Actually, even when behind the keyboard ssh is a much better idea because of encryption and such... If you need to execute commands ssh (Net::SSH) is the way to go. Depending on what it is you exactly need to do, using other protocols might also be an option... If you really are stuck with telnet a small trick that might be helpful is to blindly send the command 'echo $PS1' to the session. That will return the sequence that is used to build the prompt... But it's not identical to the prompt you'll be getting. Problem is that the prompt can change, if there are special sequences in the PS1 variable. I should point out that even this only works for the most commen *nix shells... I can telnet to my printer if I want, and that can give me another total unpredictable prompt. I'd try to find another way to access your server if I were you...
In Section
Seekers of Perl Wisdom
|
|