I am using expect to automate some database maintenance operations using sqlplus. The problem I am seeing is that about 20% of the time, when I log in to sqlplus, my expect script times out waiting for the "SQL>" prompt. I have been unable to reproduce this behavior manually. My timeout is currently set to 30 seconds although extending the timeout length has not helped. When I run the expect script in debug mode, after successfully matching/sending login information, I normally get the sqlplus banner output and eventually match the prompt, "SQL>". However, when it fails, I only get one more "line" of output from expect after the successful login which contains just a couple of spaces. After that, no more output from the spawned process to match against. Again, this happens intermittently and about 20% of the time! It seems as though expect gets "hung" at this point and longer passes output from the process for parsing. I have consulted the O'Reilly book to no avail. Any thoughts/ideas/suggestions from anyone would be greatly appreciated -- I'm stumped!