I currently have a tcl script that is sending a .tar.gz to a remote server.
spawn scp -r "file_to_send.tar.gz" $user@$host:/
set timeout 10
spawn ssh $user@$host
expect "password: "
send -- "$passwd\r"
send -- "tar -zxvf /file_to_send.tar.gz\r"
sleep 1
However, it seems like my extract doesn't work because the scp didn't fully complete. Is there a way to programmatically check when the scp is complete?