minishell/srcs/cmd_echo.c
Tanguy MAZE 4ce47a9f0b added first builtin
corrected binary execution + added echo
2018-11-27 18:38:24 +01:00

29 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cmd_echo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/27 16:14:07 by tmaze #+# #+# */
/* Updated: 2018/11/27 17:29:35 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int cmd_echo(char **argv, char **env)
{
size_t i;
(void)env;
i = 0;
while (argv[0] && argv[++i])
{
ft_putstr(argv[i]);
ft_putchar(' ');
}
ft_putchar('\n');
return (0);
}