当前位置:首页>维修大全>综合>

expect语句什么情况下执行(expected和expecting用法区别)

expect语句什么情况下执行(expected和expecting用法区别)

更新时间:2024-07-03 20:10:50

expect语句什么情况下执行

给你一个例子,注意发命令时加一个 : [code=BatchFile]#! /usr/bin/expect spawn su test expect { "Password:" { send -- "test "; }; "$" { send "ls / "; send "su root / "; expect { "Password:" { send -- "rootpw "; }; } exit; }; } [/code]

更多栏目