diff --git a/inc/minishell.h b/inc/minishell.h index c347bde..df1d28f 100644 --- a/inc/minishell.h +++ b/inc/minishell.h @@ -6,7 +6,7 @@ /* By: whaffman +#+ */ /* +#+ */ /* Created: 2025/02/04 16:13:13 by whaffman #+# #+# */ -/* Updated: 2025/02/05 16:28:59 by whaffman ######## odam.nl */ +/* Updated: 2025/02/08 19:45:37 by willem ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -19,6 +19,7 @@ # include "environment.h" # include "prompt.h" # include "tokenizer.h" +# include "executor.h" # include "utils.h" # define TRUE 1 diff --git a/src/utils/simple_builtins.c b/src/utils/simple_builtins.c index b979008..8000d36 100644 --- a/src/utils/simple_builtins.c +++ b/src/utils/simple_builtins.c @@ -6,7 +6,7 @@ /* By: whaffman +#+ */ /* +#+ */ /* Created: 2025/02/05 16:21:39 by whaffman #+# #+# */ -/* Updated: 2025/02/08 14:41:19 by willem ######## odam.nl */ +/* Updated: 2025/02/08 19:46:26 by willem ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -55,6 +55,8 @@ static int cmp_value(t_list *list, char *str) void simple_builtins(t_minishell *minishell) { + char *path; + if (cmp_value(minishell->tokens, "clear")) printf("\033[2J\033[1;1H"); else if (cmp_value(minishell->tokens, "env")) @@ -65,7 +67,16 @@ void simple_builtins(t_minishell *minishell) exit(EXIT_SUCCESS); } else if (cmp_value(minishell->tokens, "export")) - { builtin_export(minishell); + else + { + path = executor_absolute_path(minishell->environment, ((t_token *)minishell->tokens->content)->value); + if (path == NULL) + printf("minishell: %s: command not found\n", ((t_token *)minishell->tokens->content)->value); + else + { + printf("found excutable: %s\n", path); + free(path); + } } }