From a0f6ecb7a66ccc8ddcffe6e4c7a703d8c24323d8 Mon Sep 17 00:00:00 2001 From: joris schaft Date: Tue, 25 Jun 2024 14:12:40 +0200 Subject: [PATCH] [ADD] clear and echo finished --- src/builtin.c | 4 +++- src/main.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/builtin.c b/src/builtin.c index 3f29f8d..8b467f2 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/03 12:02:45 by jschaft #+# #+# */ -/* Updated: 2024/06/25 11:46:40 by jschaft ### ########.fr */ +/* Updated: 2024/06/25 13:58:48 by jschaft ### ########.fr */ /* */ /* ************************************************************************** */ @@ -88,6 +88,8 @@ int exec_builtin(t_call call, char *const envp[]) return (unset_builtin());*/ if (ft_strncmp(call.program, "pwd", 4) == 0) return (pwd_builtin()); + if (ft_strncmp(call.program, "echo", 5) == 0) + return (echo_builtin((const char **)call.argv)); if (ft_strncmp(call.program, "env", 4) == 0) return (env_builtin(envp)); return (1); diff --git a/src/main.c b/src/main.c index 4040605..b4a00e1 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/23 14:33:45 by mcolonna #+# #+# */ -/* Updated: 2024/06/21 15:48:48 by mcolonna ### ########.fr */ +/* Updated: 2024/06/25 14:08:55 by jschaft ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,6 +49,7 @@ static int do_command(t_env *env, const char *str) static void start(t_env *env) { env->mc_command = mem_subclass(fatal_error, env->mc_global); + do_command(env, "clear"); do_command(env, "cat ./header"); do_command(env, "echo"); mem_freeall(env->mc_command);