-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_built_echo.c
More file actions
executable file
·39 lines (36 loc) · 1.21 KB
/
ft_built_echo.c
File metadata and controls
executable file
·39 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_built_echo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: khsadira <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/09/11 10:03:15 by khsadira #+# #+# */
/* Updated: 2018/10/02 13:43:25 by khsadira ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_minishell.h"
int ft_built_echo(t_lst *list, t_env *env)
{
int i;
int n;
t_env *h_env;
h_env = env;
n = 0;
if (list->arg[1] && ft_strequ(list->arg[1], "-n"))
{
n = 1;
i = 2;
}
else
i = 1;
while (list->arg[i])
{
if (i != 1)
ft_putchar(' ');
ft_putstr(list->arg[i++]);
}
if (!n)
ft_putchar(10);
return (1);
}