42_minishell/builtins/env.c
Etienne Rey-bethbeder 2f386686c6 SAMANTHA EST CHAUDE
2023-02-23 17:19:25 +01:00

39 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* env.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:56:02 by cchauvet #+# #+# */
/* Updated: 2023/02/23 16:50:01 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#include "../minishell.h"
int print_env(t_list **env, int fd)
{
t_list *current;
current = *env;
while (current->next != NULL)
{
ft_putstr_fd(((t_env *)(current->content))->key, fd);
ft_putstr_fd("=", fd);
ft_putstr_fd(((t_env *)(current->content))->value, fd);
write(fd, "\n", 1);
current = current->next;
}
return (0);
}
/*int main(int argc, char *argv[], char **env)
{
t_list **be;
be = init_env(env);
print_env(be, 1);
return (0);
}*/