added basic env & setenv commands
This commit is contained in:
30
srcs/cmd_env.c
Normal file
30
srcs/cmd_env.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* cmd_env.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/12/14 15:54:45 by tmaze #+# #+# */
|
||||
/* Updated: 2019/01/13 17:48:51 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
int cmd_env(char **argv, t_list **env)
|
||||
{
|
||||
t_list *tmp;
|
||||
|
||||
if (argv[1] != NULL)
|
||||
return (0);
|
||||
tmp = *env;
|
||||
while (tmp)
|
||||
{
|
||||
ft_putstr(((t_envelem*)(tmp->content))->key);
|
||||
ft_putchar('=');
|
||||
ft_putendl(((t_envelem*)(tmp->content))->val);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
return (0);
|
||||
}
|
Reference in New Issue
Block a user