added basic env & setenv commands
This commit is contained in:
22
srcs/cmd_setenv.c
Normal file
22
srcs/cmd_setenv.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* cmd_setenv.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/01/13 16:20:20 by tmaze #+# #+# */
|
||||
/* Updated: 2019/01/13 17:05:05 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
int cmd_setenv(char **argv, t_list **env)
|
||||
{
|
||||
if (argv[1] == NULL)
|
||||
return (-1);
|
||||
if (env_addupdate(argv[1], argv[2], env) == NULL)
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
Reference in New Issue
Block a user