Para automatizar a iteração, você pode fazer isso:
#!/usr/bin/expect
spawn ./offset_fitm_exp
set range 1.6
set azimuth 1.0
while {true} {
expect "enter minimum cross-correlation threshold:"
send "0.15\r"
expect "enter the range and azimuth error thresholds:"
send "$range $azimuth\r"
expect -re {range: ([0-9.]+) azimuth: ([0-9.]+} {
set range $expect_out(1,string)
set azimuth $expect_out(2,string)
}
expect "set new error bounds? (0: no, 1: yes):" {
if {$range > 0.02 || $azimuth > 0.02} {
send "1\r"
} else {
send "0\r"
break
}
}
}
interact