N K Krishnan
2011-02-21 22:06:24 UTC
ran into the same problem and after staring at the debug output for a while,
moved the sending of the "\r" to after the expect block.
# we are logged in, now figure out the full prompt
# send "\r"
expect {
-re "\[\r\n]+" { exp_continue; }
-re "^.+$prompt" { set junk $expect_out(0,string);
regsub -all "\[\]\[]" $junk {\\&} prompt;
}
-re "^.+> \\\(enable\\\)" {
set junk $expect_out(0,string);
regsub -all "\[\]\[]" $junk {\\&} prompt;
}
}
send "\r"
and that seemed to have the desired result.
moved the sending of the "\r" to after the expect block.
# we are logged in, now figure out the full prompt
# send "\r"
expect {
-re "\[\r\n]+" { exp_continue; }
-re "^.+$prompt" { set junk $expect_out(0,string);
regsub -all "\[\]\[]" $junk {\\&} prompt;
}
-re "^.+> \\\(enable\\\)" {
set junk $expect_out(0,string);
regsub -all "\[\]\[]" $junk {\\&} prompt;
}
}
send "\r"
and that seemed to have the desired result.