[mishandles case where receiver fills its filesystem?]
EE - I have an Expect program developed as part of the remote management of several hundred servers. This script has a list of remote servers to manage, and for each server, it starts and ssh session, logs in to the remote server, transfers a shell script, runs it, and captures the results. The shell script it transfers can do pretty much anything, so this can be used for things as diverse as adding or deleting a user, locking or unlocking an account, OS patching operations, gathering statistics from all servers, or software deployment/configuration, or security scanning/auditing. This Expect program transfers its shell script in exactly the same way as the ftp-inband example that comes with Expect. The method, step by step, is this:
There is a potential failure here. When sending the uuencoded data to the remote end, if the filesystem holding the remote_temporary_file fills up, the cat will abort, and the remaining portion of the uuencoded data and the EOF signal will be received by the shell at the other end instead of the cat. When the shell received EOF, it will exit, and the next attempt to communicate with that session will cause a script error.