case insensitive prompt matching

Tom Metro tmetro-blu-5a1Jt6qxUNc at public.gmane.org
Wed May 27 16:44:10 EDT 2009


Greg Rundlett wrote:
> I've seen many tutorials or examples that include expect
> "assword", and note that you don't have to chop off the 'p' to avoid
> problems with case-sensitivity.
> 
> ...I wonder if the prevalence of one
> particular early example has led to this current indelicateness.  Or,
> perhaps -nocase and -re options were added later.

I suspect the technique predates expect. I've seen it used by countless 
terminal, SLIP, PPP, and other login automation scripts. It was probably 
carried over to expect as a "best practice."

In the original case, it makes sense, as the scripting language was 
usually very simple, and it had to deal with a variety of target systems.

In the context of this thread, it makes little sense. It's highly 
improbable that su or passwd would change their prompt capitalization, 
and if they did (or say you tried sing this function on a non-Linux 
system), it's likely all the other prompting would be different too.

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/





More information about the Discuss mailing list