Redirect output of commands to file properly