I have a sftp file script with below details,my server folder like BCP11,BCP12,BCP13,BCP14.....BCPXX. In which BCPDUMP folder have files.Filename :  file_sftp.sh#!/usr/bin/expectspawn sftp user@xx.xxx.x.xxxexpect user@xx.xxx.x.xxx's password:send password\nexpect sftp>send get *Backup/GetBackup/BCP*/*BCPDUMP/20150925/20150925_profile*\nexpect sftp>send bye\nWhen i am executing this script i am getting only one file while the server have approx 12 files. i am getting below script output.spawn sftp user@xx.xxx.x.xxx  Connecting to xx.xxx.x.xxx...  Password:  sftp> get *Backup/GetBackup/BCP*/*BCPDUMP/20150925/20150925_profile*  Couldn't get handle: No such file or directory^M  Couldn't get handle: No such file or directory^M  Couldn't get handle: No such file or directory^M  Fetching   /rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z to 20150925_profile_410.list.Z^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z 0%    0     0.0KB/s   --:-- ETA^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z                                                           66% 1152KB   1.1MB/s   00:00 ETA^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z                                                          100% 1730KB 864.9KB/s   00:02  
All files are not getting downloaded by SFTP script
shell script;sftp;vsftpd;vsftp
Try this construct when command is time consuming:send command\rexpect {     timeout {         puts Running...         exp_continue     }     %PROMPT% {         puts Finished.     } }send next command\rOn timeout you will be continuosly waiting with exp_continue command for %PROMPT%.