[ADD] clear and echo finished
This commit is contained in:
parent
4af738e2ee
commit
a0f6ecb7a6
2 changed files with 5 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
||||||
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/06/03 12:02:45 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());*/
|
return (unset_builtin());*/
|
||||||
if (ft_strncmp(call.program, "pwd", 4) == 0)
|
if (ft_strncmp(call.program, "pwd", 4) == 0)
|
||||||
return (pwd_builtin());
|
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)
|
if (ft_strncmp(call.program, "env", 4) == 0)
|
||||||
return (env_builtin(envp));
|
return (env_builtin(envp));
|
||||||
return (1);
|
return (1);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/04/23 14:33:45 by mcolonna #+# #+# */
|
/* 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)
|
static void start(t_env *env)
|
||||||
{
|
{
|
||||||
env->mc_command = mem_subclass(fatal_error, env->mc_global);
|
env->mc_command = mem_subclass(fatal_error, env->mc_global);
|
||||||
|
do_command(env, "clear");
|
||||||
do_command(env, "cat ./header");
|
do_command(env, "cat ./header");
|
||||||
do_command(env, "echo");
|
do_command(env, "echo");
|
||||||
mem_freeall(env->mc_command);
|
mem_freeall(env->mc_command);
|
||||||
|
|
Loading…
Add table
Reference in a new issue