shlvl_init(), set SHLVL
+ export builtin small change
This commit is contained in:
27
srcs/retrieve_path.c
Normal file
27
srcs/retrieve_path.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user