gpt4 book ai didi

linux - 在unix中运行expect时出错

转载 作者:太空宇宙 更新时间:2023-11-04 05:43:05 25 4
gpt4 key购买 nike

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

最佳答案

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

关于linux - 在unix中运行expect时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40601098/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com