This commit is contained in:
Loic Deridder
2025-01-28 10:56:15 +01:00
parent 5c3cd44e5a
commit 66ebd61d6f
17 changed files with 252 additions and 254 deletions

View File

@@ -6,22 +6,27 @@
/* By: lderidde <lderidde@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/24 14:32:04 by lderidde #+# #+# */
/* Updated: 2025/01/24 14:32:04 by lderidde ### ########.fr */
/* Updated: 2025/01/28 09:54:32 by lderidde ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../includes/builtins.h"
void builtin_env(char *str, char **envp)
int builtin_env(char **arg, char **envp)
{
int i;
i = 0;
(void)str;
if (count_args(arg) > 1)
{
err_msg_cmd("env", NULL, "too many arguments", 1);
return (1);
}
while (envp[i])
{
if (envp[i][0] && ft_strchr(envp[i], '=') != NULL)
printf("%s\n", envp[i]);
i++;
}
return (0);
}