matching Cisco config prompt

john heasley heas at shrubbery.net
Thu Feb 13 18:09:03 UTC 2003


Thu, Feb 13, 2003 at 07:09:49AM -0800, Rizzo, Joe:
> Mr. Heasley / Mr. Partan,
> 
> Is this an acceptable way to match the Cisco prompt once in config mode?
> I.E. 'hostname(config)#', 'hostname(config-router)#',
> 'hostname(config-etc)#', etc

unfortunately, i think this needs to be a little more involved.  we
need to take care of the following cases:

	- ios prompt foo[#>]
	- ios config prompt foo(config)#
	- ios truncated prompt somereallylongprompttrunc(config)#
	- catalyst prompt foo>
	- catalyst enable prompt foo (enable)>
	- catalyst - does the cat change the prompt in config mode?
	- catalyst - does the cat truncate long prompts?

i need to get my catalyst running...

> diff -u clogin.orig clogin
> --- clogin.orig Wed Feb 12 15:33:02 2003
> +++ clogin      Wed Feb 12 16:30:56 2003
> @@ -458,7 +458,7 @@
>         }
>         regsub -all "\[)(]" $prompt {\\&} reprompt
>         # match cisco config mode prompts too, but not for catalyst ie:
> (enable)
> -       regsub -all "\[#>]$" $reprompt {(\\([^\\r\\n]+\\))?&} reprompt
> +       regsub -all "\[#>]$" $reprompt {(\(config.*\))?&} reprompt
>         expect {
>             -re $reprompt       {}
>             -re "\[\n\r]+"      { exp_continue }
> 
> Thanks,
> Joe




More information about the Rancid-discuss mailing list