在unix中运行expect时出错

时间:2016-11-15 02:34:29

标签: linux shell unix expect aix

在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"
"

1 个答案:

答案 0 :(得分:1)

删除转义的引号。看看它试图运行的最终命令:"cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf" "它应该运行正常,没有转义引号。