技术解析

expect git invalid command
0
2021-07-02 17:18:31
idczone

expect 脚本

#!/usr/bin/expect -f
puts "pwd [pwd]"
git status

expect "$ " {
    send $expect_out(0,string)
}

开启 debug 运行结果:

expect version 5.45
argv[0] = expect  argv[1] = -d  argv[2] = /home/cqh/Nutstore/excode/ch5/get_branch.exp  
set argc 0
set argv0 "/home/cqh/Nutstore/excode/ch5/get_branch.exp"
set argv ""
executing commands from command file /home/cqh/Nutstore/excode/ch5/get_branch.exp
pwd /data/youmicode/wind
invalid command name "git"
    while executing
"git status"
    (file "/home/cqh/Nutstore/excode/ch5/get_branch.exp" line 3)

这种问题怎么解决啊,把git status替换成spawn git status 也不行


这个记录怎么删除的?

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服