48 dup2(fd, STDOUT_FILENO);
70 if (waitpid(pid, &status, 0) == -1)
72 if (WIFSIGNALED(status))
73 return (128 + WTERMSIG(status));
74 return (WEXITSTATUS(status));
int execute_ast(t_ast *node, t_ms_data *data)
execute Abstract Syntax Tree
int redirect_out(t_ast *node, t_ms_data *data)
static int open_and_redirect(t_ast *node, t_ms_data *data)
redirect out ">" to the file output
int open_file(t_ast *node, char *direction)
open file in the context of redirection