in reply to Net::Telnet stalls

As your first command, before you scan for the prompt, set their prompt; just send
PS1='$'
export PS1
But you don't know for sure what shell they'll have, so why not start up the one you want?
exec env PS1='$' /bin/bash
You might want to set their path, too, to make sure you're really running the program you expect to be. In fact, why not clear out their current environment and start up bash without reading their .bashrc or .profile at all?
exec env - PS1='$' PATH=/usr/bin:/bin /bin/bash --norc --noprofile

Replies are listed 'Best First'.
Re: Re: Net::Telnet stalls
by jcpunk (Friar) on Jun 19, 2003 at 14:37 UTC
    Is that possible under Net::Telnet? forgive my ignorence but i thought that it automatically checked for a prompt as part of the login() sub, I may be, and likely am wrong on this but it was my understanding that the scanning for a prompt was automatic.

    but as i am likely wrong on this (im not terribly familiar with Net::Telnet) it is a good idea

Re: Re: Net::Telnet stalls
by JoeJaz (Monk) on Jun 19, 2003 at 14:54 UTC
    This is an interesting idea. I never really knew that you could prevent the bashrc from being read when you enter a shell... or at least I never really knew how. This is useful. I will definately look into this. Thank you very much.