在 unix 中 运行 expect 时出错
Error while running expect in unix
在 运行 期待 bash 脚本中的脚本时出错
输入:
{
/usr/bin/expect << EOF
spawn ssh execsped@10.150.10.194 "cd /home/execsped/ram_test_72;./testecho.sh \"$evenno\" \"$eisinno\" \"$efilename\""
expect "Password"
send "abc@123\r"
expect "*#*"
EOF
}
输出:
extra characters after close-quote
while executing
"spawn ssh execsped@10.150.10.72 "cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf"
"
删除转义引号。查看它尝试执行的最终命令 运行:"cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf" "
如果没有转义引号,它应该 运行 没问题。
在 运行 期待 bash 脚本中的脚本时出错
输入:
{
/usr/bin/expect << EOF
spawn ssh execsped@10.150.10.194 "cd /home/execsped/ram_test_72;./testecho.sh \"$evenno\" \"$eisinno\" \"$efilename\""
expect "Password"
send "abc@123\r"
expect "*#*"
EOF
}
输出:
extra characters after close-quote
while executing
"spawn ssh execsped@10.150.10.72 "cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf"
"
删除转义引号。查看它尝试执行的最终命令 运行:"cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf" "
如果没有转义引号,它应该 运行 没问题。