expect command spawns incorrectly



I am trying to use the expect program to automate an sftp process....

The expect file begins with

spawn sftp -oProxyCommand='....' user@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
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Relevant Pages

  • Re: [SLE] Getting Dreamweaver to connect to SFTP via vsftpd
    ... >> I seem to be running into a little trouble getting Dreamweaver to ... >> connect to my home computer from work via SFTP option within ... >> OSX machine using the sftp command. ... the ftp server but using the sftp command I can connect. ...
    (SuSE)
  • sftp status error/status code
    ... Is there a way to receive "sftp status codes" as part of the sftp command response message on stdout, when an sftp command is issued on stdin. ...
    (SSH)
  • OpenSSH SFTP Question.
    ... SFTP command to transfer files from host-a to host-b, ... [cj037@stotslin1 scripts]$ sftp cj037@stotstru01 ...
    (SSH)
  • SecureFX, Public-Keys and SFTP Script?
    ... I need to create a job that runs an sftp script nightly. ... do this using ftp, but after researching I see that you can't use the ... key in my sftp command line script. ...
    (comp.security.ssh)
  • Re: Different SSH auth method for one user
    ... If you want to automate sftp file transfers then using public/private ... and on the on the client side either don't encrypt the private key (less ... automatically is to setup is public key in the server, and the private key ...
    (comp.os.linux.security)