I am trying to use the expect program to automate an sftp process....<br><br>The expect file begins with<br><br>spawn sftp -oProxyCommand='....'  user@host<br>expect "password:"<br>send "sesame\n"<br>

expect "sftp> "<br><br><br>It never gets the part to ask for the password, instead the sftp command fails, showing the "usage".<br><br>However, if I cut/past the sftp command, it work fine...<br><br>

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

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