aboutsummaryrefslogtreecommitdiff
path: root/src/builtins_part_two.c
diff options
context:
space:
mode:
authorChristopher Uhlig2025-01-14 18:18:58 +0100
committerChristopher Uhlig2025-01-14 18:18:58 +0100
commitda80405b345b58f9e1bd83039b1df3771b5ca193 (patch)
treed8ddb9fa078fa353dc55992dd9609a0c798e56ad /src/builtins_part_two.c
parent8c37f835ba29bcecc1d779edb396d97b18667026 (diff)
downloadminishell-da80405b345b58f9e1bd83039b1df3771b5ca193.tar.gz
minishell-da80405b345b58f9e1bd83039b1df3771b5ca193.zip
update for exit bit norm removed staic stuff added prompt flag
Diffstat (limited to 'src/builtins_part_two.c')
-rw-r--r--src/builtins_part_two.c27
1 files changed, 26 insertions, 1 deletions
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 <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
+}