我今天一直在玩 Expect/TCL,我希望有人能告诉我为什么下面的脚本会失败:
: command not found
./expect3: line 3: send: command not found
#!/usr/bin/expect -f
send " we are going to open up a file for reading, ok? \n"
expect "ok"
set fileopen [open "/home/aaron/text.txt" "r"]
set a [read $fileopen]
send "i am expecting to see a string from the file here $fileopen"
close $fileopen
send 和 close 命令都失败了,但我用 spawn 命令编写的其他脚本似乎工作正常?