matching Cisco config prompt

Rizzo, Joe JRizzo at ea.com
Thu Feb 13 15:09:49 UTC 2003


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

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