I need to recover a file from a REST request, this request asks for my password, but I need it to be automatic, so I'm using an expect script in order to enter my password without need for human interaction. My problem is that I don't know how to get the file after the password is sent.
Here's the expect script :
#!/usr/bin/expect
set password [lindex $argv 0]
spawn [lindex $argv 1] {*}[lrange $argv 2 end]
expect "Enter host password for user \'*\':*" {send "$password\r"; interact}
And here's the call to the script :
./pgbExpectLog.sh $password curl -Lu $adobeId https://build.phonegap.com/api/v1/apps/$appId/ios
I need to catch the data that follows the sending of my password and redirect it into a file, I can't do a simple redirection ('>') in my bash script because I would get the "spawn [command]" and "Enter password:" lines with a bit of corrupted data, so I need to log into the expect script, but I don't know where and how.