tout debut implementation pipes

This commit is contained in:
hugogogo
2021-10-15 18:17:26 +02:00
parent 97ab70c475
commit 98f247a378
5 changed files with 59 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */
/* Updated: 2021/10/10 15:13:26 by hulamy ### ########.fr */
/* Updated: 2021/10/15 17:33:46 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,6 +28,8 @@ void shell_loop(t_all *c)
builtin_env(0, NULL, c);
else if (!ft_strncmp(line_input, "exit", 5)) // temp placeholder
builtin_exit(0, NULL, c);
else if (!ft_strncmp(line_input, "pipe ", 5)) // temp temp temp
pipes_hugo(line_input);
else
printf("echo: %s\n", line_input);
}
@@ -71,12 +73,3 @@ int main(int argc, char *argv[], char *envp[])
return (0);
}
/*
** idea about malloc protection :
** have them(mallocand similar) done in a specific function that would check their return and accordingly exit the program or continue
** -> so that it can be done in one line
** void calloc_or_exit(int num, int size);
** and possibly give it a pointer to a function that will clean before exit
** void calloc_or_exit(int num, int size, void (*f)(void *ptr), void *ptr);
*/