I'm creating a custom login script for a Crescendo load balancer device. I can log in to the device and get to interactive mode ok using the script, but when I try to run commands with something like:
<div><br></div><div>crescendologin -d -t 30 -c"show running" host</div><div><br></div><div>it appears that expect is trying to match on every character with output like:</div><div><br></div><div>...</div><div><div>
<div>send: sending "show running\r" to { exp6 }</div></div><div><br></div><div>expect: does "" (spawn_id exp6) match regular expression "^[^\n\r]*root> "? no</div><div>"^[^\n\r ]*>>.*root> "? no</div>
<div>"[\n\r]+"? no</div><div><br></div><div>expect: does "s" (spawn_id exp6) match regular expression "^[^\n\r]*root> "? no</div><div>"^[^\n\r ]*>>.*root> "? no</div><div>
"[\n\r]+"? no</div><div>expect: timed out</div><div><br></div><div>Error: TIMEOUT reached</div></div><div><br></div><div>I feel like I'm missing something obvious. The pertinent section of run_commands looks like:</div>
<div><br></div><div><div> for {set i 0} {$i < $num_commands} { incr i} {</div><div> send -- "[subst -nocommands [lindex $commands $i]]\r"</div><div> expect {</div><div> -re "^\[^\n\r]*$reprompt" { exp_continue }</div>
<div> -re "^\[^\n\r *]*$reprompt" {}</div><div> -re "\[\n\r]" { exp_continue }</div><div> }</div><div> }</div></div><div><br></div><div>And the actual prompt is "root> "</div>
<div><br></div><div>Thanks for any help.</div><div><br></div><div>BT</div><div><br></div>