Hey everyone, I'm currently working on a Bash / Expect script that will sftp to a server, pull down some .txt files, run some commands, and then exit. Right now I'm actually having problems with the Expect piece of the script.

It all works fine until I run the mget command. For some reason it only gets the first file, and then part of the second. I'm not sure why this happens and haven't found much on my own in the Expect Man Page. http://www.tcl.tk/man/expect5.31/expect.1.html.

Any suggestions on how I can make sure that I get ALL the files before expect exits?

UPDATE:Finally found the solution. In passing the Expect Man Page says that the default timeout for "expect" is 10 seconds. I just had to set that to a longer time so that it would wait for the file transfer to finish. The correct script is below:

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum