最佳答案
我在 Expect 中通过 shell 脚本中的命令行传递参数。
我试过了
#!/usr/bin/expect -f
set arg1 [lindex $argv 0]
spawn lockdis -p
expect "password:" {send "$arg1\r"}
expect "password:" {send "$arg1\r"}
expect "$ "
但是没有用,我怎么才能修好它?