From da80405b345b58f9e1bd83039b1df3771b5ca193 Mon Sep 17 00:00:00 2001 From: Christopher Uhlig Date: Tue, 14 Jan 2025 18:18:58 +0100 Subject: update for exit bit norm removed staic stuff added prompt flag --- src/builtins_part_two.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/builtins_part_two.c') diff --git a/src/builtins_part_two.c b/src/builtins_part_two.c index f54e04f..5af6c68 100644 --- a/src/builtins_part_two.c +++ b/src/builtins_part_two.c @@ -6,7 +6,7 @@ /* By: chuhlig +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/25 20:52:16 by chuhlig #+# #+# */ -/* Updated: 2024/12/20 18:53:03 by chuhlig ### ########.fr */ +/* Updated: 2025/01/14 14:26:39 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -82,3 +82,28 @@ int cd(t_env **env, char **av) } return (0); } + +int pwd(t_env *env) +{ + while (env) + { + if (ft_strncmp(env->name, "PWD", 4) == 0) + { + ft_printf("%s\n", env->value); + break ; + } + env = env->next; + } + return (0); +} + +int ft_env(t_env *env) +{ + while (env != NULL) + { + printf("%s", env->name); + printf("=%s\n", env->value); + env = env->next; + } + return (0); +} -- cgit v1.2.3