Moved send/wait eof to closeShell