works for single i/o redirection