expect command spawns incorrectly

Donald Russell russell.don at gmail.com
Sun Nov 29 00:13:41 UTC 2009


On Sat, Nov 28, 2009 at 15:47, Steven W. Orr <steveo at syslang.net> wrote:

> On 11/28/09 02:43, quoth Donald Russell:
> > I am trying to use the expect program to automate an sftp process....
> >
> > The expect file begins with
> >
> > spawn sftp -oProxyCommand='....'  user at host
> > expect "password:"
> > send "sesame\n"
> > expect "sftp> "
>
> Try this:
>
> send "sesame\r"
>
>
I'll try that, but I'm not hopeful.

The command that is spawned fails... I get the "usage" as if all that was
spawned was "sftp" and not the entire command. So it doesn't even get to the
"expect password" part, regardless of whether I'm using \n or \r in the
"send".

And I gather there is no such character on the "spawn" line... the command
is just taken to be the literal characters up to the end-of-line.
Do I need to escape anything? As I mentioned, if I cut/past the command into
a shell.. it works fine... it's just got being spawned properly by expect.
(Or I'm doing something wrong :-( )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20091128/0a59fa5b/attachment-0001.html 


More information about the users mailing list