shlvl_init(), set SHLVL

+ export builtin small change
This commit is contained in:
LuckyLaszlo
2021-12-08 06:36:52 +01:00
parent bcc82aabaf
commit cee6a8962b
5 changed files with 61 additions and 19 deletions

27
srcs/retrieve_path.c Normal file
View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* retrieve_path.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
/* Updated: 2021/12/08 06:27:23 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
char **retrieve_path(void)
{
char *path;
char **path_split;
path = getenv("PATH");
if (!path)
return (ft_retp_print(NULL, "minishell: Warning, $PATH not set\n", 2));
path_split = ft_split(path, ':');
if (!path_split)
return (ft_retp_perror(NULL, "retrieve_path()"));
return (path_split);
}