Rishabh Rishabh - 9 months ago 61
Linux Question

error while running expect in unix

Getting error while running expect script in bash script



/usr/bin/expect << EOF

spawn ssh execsped@ "cd /home/execsped/ram_test_72;./testecho.sh \"$evenno\" \"$eisinno\" \"$efilename\""

expect "Password"

send "abc@123\r"

expect "*#*"




extra characters after close-quote

while executing

"spawn ssh execsped@ "cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf"

Answer Source

remove the escaped quotes. look at the final command it's trying to run: "cd /home/execsped/evoting_test_72;./testecho.sh "10575" "_eVoting.pdf" "abc.pdf" " it should run fine without the escaped quotes.