- This topic has 1 reply, 2 voices, and was last updated 11 years, 9 months ago by .
-
Topic
-
How can you cause a tcl proc to delay? I’m executing an expect script, SFTP, to pick up multiple files from a remote server. During the looping, the cloverleaf process hangs then stops. My thread is set to an ‘Upoc’ and I’m using advance scheduling to execute the script at a particular time. Again, it starts to execute but then stops. Any ideas?
Here’s part of the script.
Code:
# create expect script
set es [open $esn w]
puts $es “spawn sftp $user@$host”
puts $es “expect {”
puts -nonewline $es {”password:” }
puts $es “{send “$password\n”}”
puts $es {”Connection closed” return}
puts $es “}”puts $es {expect “sftp>”}
puts $es “send “cd $remoteFile\n””puts $es {expect “sftp>”}
puts $es “send “ls \n””puts $es “expect {”
puts -nonewline
puts $es {-re “sftp > *.pdf”}
puts $es “}”puts $es “set out $expect_out(buffer)”
puts $es “foreach file [split $out \r\n] {”
#puts $es ” send_user “DEBUG $file”n”
puts $es “send “get $file /opt/quovadx/qdx5.7/integrator/cerner_cert/data/integrity/notes\n””
puts $es “send “rm $file\n””
puts $es “}”puts $es {expect “sftp>”}
puts $es “send “bye\n””
flush $es
close $esset retVal [exec /opt/quovadx/qdx5.7/integrator/tcl/bin/expect $esn >>& /opt/quovadx/qdx5.7/integrator/temp/integrity_cn_sftp.out]
- The forum ‘Tcl Library’ is closed to new topics and replies.