Expect Script - Not Seeing Output from While Loop

I know something simple is missing here, "log_user 1" is set . . . after this utility opens ${InFile} (handle? for IntInFile) it needs to look for something to appear in the file ${IntInFile} and then send it to the spawned process. Then I am locking the file ${IntInFile} and clearing it out - expecting more activity later from another process which locks it the same way.

The purpose of this utility is to allow strings to appear and re-appear in a file, and drive the spawned process via those strings, which most likely will be options to menu programs etc.

All that works fine, I know that the activities are happening as directed by options/etc read from ${IntInFile}, except I never see any output from those activities. I do see standard out from the initial spawn (perhaps when ${MenuPrompt} gets matched?). Once I get past this I'll add some detection for when the spawned process ends to get out of the loop, that should be about it.

I've tried several things to get some output during these while loops, like the "expect *" and "puts . . .", nothing yet. Can anyone tell me what I'm missing here?

log_user 1

# Read hostname to connect to from arguments
set hostname    [ lindex $argv 0 ]
# Read ID
set adminID     [ lindex $argv 1 ]
# Read prompt to look for, to initiate interaction
set MenuPrompt  [ lindex $argv 2 ]
# Read input file used for interaction
set IntInFile   [ lindex $argv 3 ]
set IntInFileNm [ exec basename ${IntInFile} ]
set IntInFileDr [ exec dirname ${IntInFile} ]
# Read command to run
set RunCmd      [ lindex $argv 4 ]
# Set time to sleep between checks for input
set Sleep       5
# Set time to sleep between checks for input
set MyPID       [ pid ]
# Initialize var for commands to run to clean up after interaction input file
set Cmd         ""
# File handle/identifier for interaction input file.
set InFile      [ open ${IntInFile} ]

# The command/program should have started within this amount of time.
set timeout     25
# Set to name of running program.
set Me          "${argv0}"
# Set to name of running program's directory.
set MyDir       [ exec dirname ${Me} ]
# Set command to be spawned
set SpawnCmd    "ssh ${adminID}@${hostname} -oStrictHostKeyChecking=no \
    ${RunCmd}"

# Spawn SSH shell connection to target machine and execute command.
eval spawn -noecho ${SpawnCmd}

# Wait for IntInFile to have size, the send the contents as input to the
# spawned process, lock the IntInFile, empty it and then unlock it.
# Look for the specified menu prompt from the command/program called.
expect -re ${MenuPrompt} {
    while { 1 } {
        # Wait between checks for input to send.
        while { [ file size ${IntInFile} ]==0 } {
            expect * {
                puts "$expect_out(buffer)"
                sleep ${Sleep}
            }
        }
        # Send the chararacters in IntInFile to the process.
        gets ${InFile} Buff
        send -- "${Buff}\r"

        # Lock instance to clean out interaction input file.
        set Cmd "${MyDir}/InstLock.sh -n1 -wf \
            ${IntInFileDr}/Lock.${IntInFileNm} -p ${MyPID}"
        if [ catch [ eval exec ${Cmd} ] ] {
            puts "ERROR: executing ${Cmd} - ${CmdOut}"
        }
        # Remove interaction input file.
        set Cmd "rm ${IntInFile}"
        if [ catch [ eval exec ${Cmd} ] ] {
            puts "ERROR: executing ${Cmd} - ${CmdOut}"
        }
        # Re-initialize interaction input file.
        set Cmd "touch ${IntInFile}"
        if [ catch [ eval exec ${Cmd} ] ] {
            puts "ERROR: executing ${Cmd} - ${CmdOut}"
        }
        # Remove lock file.
        set Cmd "rm ${IntInFileDr}/Lock.${IntInFileNm}.1"
        if [ catch [ eval exec ${Cmd} ] ] {
            puts "ERROR: executing ${Cmd} - ${CmdOut}"
        }
    }
} timeout {
    puts "No response from command invoked - ${SpawnCmd}"
    puts "$expect_out(buffer)"
    send -- "^C"
    exit 1
}

Many Thanks in Advance