[lug] Expect over SSH Problems
George Sexton
georges at mhsoftware.com
Wed Feb 5 17:48:56 MST 2020
Well, I figured it out. I think it was a mixture of not waiting for
"expect eof" to get the buffer, and then the expect matches were hitting
things to fast. I made one match a little more specific, and it solved
the issue.
On 2/5/2020 3:51 PM, George Sexton wrote:
> 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