Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My script below works but trying to make it smarter. What I'd like for it to do is to parse the response, such as, AR1_6 in "execute . AR1_6" and send that as variable in proc send_packet_from_bsd instead of having a case for every response.
Java
while { [gets $tests_to_run TEST] >= 0 } {

   set test_done 0

   send "t $TEST\r"
   sleep 2
   while { $test_done == 0 } {
      expect {
         "execute . AR1_6" { send_packet_from_bsd "AR1_6" }
         #"execute . AR1_16" { send_packet_from_bsd  "AR1_16" }
         #"execute . AR1_14" { send_packet_from_bsd  "AR1_14" }
         #"execute . AR1_1" { send_packet_from_bsd  "AR1_1" }
         "Test \* Complete" { set test_done 1 }
      }
   }
}
Posted
Updated 9-May-14 12:10pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900