expect git invalid command

2016-08-30 11:37:34 +08:00
 chenqh

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 也不行

1642 次点击
所在节点    Linux
1 条回复
chenqh
2016-08-30 11:44:20 +08:00
这个记录怎么删除的?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/302636

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX