Open oooooorriiiii opened 2 years ago
void execute_simple_command(t_astree *simple_cmd_node, t_cmd_args *args)
{
char *path;
init_command_struct(simple_cmd_node, args);
// print_allstruct(args);
if (!check_builtin(args->cmdpath[0]))
{
path = add_path(args);
if (access(path, X_OK) == -1)
g_minishell.exit_status = 126;
if (!path)
g_minishell.exit_status = 127;
free_str(&path);
}
if (joudge_process(args) == 1)
execute_in_parent(args);
else
execute_in_child(args);
destroy_command_struct(args);
}