在bash脚本中运行expect脚本时出错
输入:
{
/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"
"
答案 0 :(得分:1)
删除转义的引号。看看它试图运行的最终命令:"cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf" "
它应该运行正常,没有转义引号。