Enclose the command between exec and the redirections to emulate the fork, fork, exec trick in C.