Handle redirection of command I/O.