[ADD] clear and echo finished

This commit is contained in:
joris schaft 2024-06-25 14:12:40 +02:00
parent 4af738e2ee
commit a0f6ecb7a6
2 changed files with 5 additions and 2 deletions

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);