Removed the references to shell.close, which no longer exists.  The shell is closed by closing the input pipe.