[lug] Expect over SSH Problems

George Sexton georges at mhsoftware.com
Wed Feb 5 15:51:25 MST 2020


I'm running into some problems executing an expect script over an ssh 
connection. I have something like:


expect <<-EOF
spawn ssh -e none user at somehost
expect "~]$ "
send "somecommand \n"
...
EOF

When I run the command from US host - US host, it works as expected.

When I run the command from US Host -> European Host, the last 4-5 
commands don't get executed. There are no errors or diagnostics. Of 
course if I run expect -d it works (heisenberg loves me).

I've tried setting -e none for ssh, quoting and escaping things, and it 
just doesn't make sense. I moved some things that weren't executed 
higher, and they run, but things that were executing that are now lower 
get dropped off. It's kind of like I only get so many lines of operation 
and it fails.

Does anyone here have any ideas?


-- 
George Sexton
(303) 438 9585 x102
MH Software, Inc.


More information about the LUG mailing list