/** * Perform actual tree execution */ static int do_execute(CommandNode *node) { if (node==NULL) return 0; switch (node->type) { case CN_COMMAND: return do_command(node); case CN_PIPE: return do_pipe(node); case CN_SUBSHELL: return do_subshell(node); case CN_BACKGROUND: return do_background(node); case CN_CHAIN: case CN_OR: case CN_AND: return do_chain(node); default: assert(0); return 1; } }
void subshell(t_shell *shell, t_command *cmd) { if (cmd->argc > 1) { ft_printf("42sh : parse error after %s\n", cmd->path); exit(1); } do_subshell(shell, chop_limit(cmd->path), 1); }