expect command spawns incorrectly

Donald Russell russell.don at gmail.com
Sat Nov 28 07:43:49 UTC 2009


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


It never gets the part to ask for the password, instead the sftp command
fails, showing the "usage".

However, if I cut/past the sftp command, it work fine...

It's as though the expect program is somehow messing up the command string
to be "spawned".
I've tried various uses of quotes and so on, but I just can't get past this.

The -d option on expect doesn't really show me the correct detail other than
it says it is spawning the correct commend... yet sftp always returns with
"the correct usage help text", so obviously what it says it's doing and
what's actually being done isn't quite the same.

Does anybody have any experience with "expect" that could shed some light on
this?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20091127/0f2b43c5/attachment-0001.htm>


More information about the fedora-list mailing list