Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 if 块作用域,下面的设置if似乎没有生效:
if
16 if {[string compare "$DEBUG" "ON"]!=0} { 17 exp_internal 1 18 } 19 Rest of code that want the debug to be ON.
有没有办法使设置全局化,因为其余代码取决于它。
谢谢。
if { "$DEBUG" == "ON" } { exp_internal 1 }
处理您可能希望将-d选项传递给期望二进制文件的全局设置。根据手册页:
-d
此标志与Expect脚本开头的“exp_internal 1”效果相同,加上打印Expect的版本