MiniDevil As beautiful as a shell
builtin_env.c File Reference

Implements env: displays all env variables. More...

#include "builtins.h"
#include "libft.h"
+ Include dependency graph for builtin_env.c:

Detailed Description

Implements env: displays all env variables.

Definition in file builtin_env.c.

Functions

int builtin_env (char **args, t_env *env)
 Implement the env command. More...
 

Function Documentation

◆ builtin_env()

int builtin_env ( char **  args,
t_env env 
)

Implement the env command.

Print all environment variables which have a value in "KEY=VALUE" format, one per line and rejecting extra arguments.

Parameters
argsNULL terminated arguments array with arg[0] = "env"
envEnvironment list to print
Returns
0 on success and 1 if extra arguments were given

Definition at line 26 of file builtin_env.c.

References t_env::key, t_env::next, and t_env::value.

Referenced by exec_builtin().

+ Here is the caller graph for this function:

Go to the source code of this file.