2017-05-30 59 views

回答

0

見希望的手冊頁:

expect [[-opts] pat1 body1] ... [-opts] patn [bodyn] 

     ... ... 

     If the arguments to the entire expect statement require more than 
     one line, all the arguments may be "braced" into one so as to 
     avoid terminating each line with a backslash. In this one case, 
     the usual Tcl substitutions will occur despite the braces. 

     ... ... 

     For example, the following fragment looks for a successful login. 
     (Note that abort is presumed to be a procedure defined elsewhere 
     in the script.) 

      expect { 
       busy    {puts busy\n ; exp_continue} 
       failed    abort 
       "invalid password" abort 
       timeout   abort 
       connected 
      }