42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
environnement.c File Reference

The file containing the environnement functions. More...

Functions

char * get_env_var (char **env, char *var)
 Get an environment variable.
 
void replace_env_var (char **env, char *name, char *value)
 Replace an environment variable.
 
void check_path (mysh_t *mysh)
 Check if the PATH is set in the environment and set it if not.
 
void update_path_list (mysh_t *mysh)
 Update the path list.
 

Detailed Description

The file containing the environnement functions.

Function Documentation

◆ check_path()

void check_path ( mysh_t * mysh)

Check if the PATH is set in the environment and set it if not.

Parameters
myshThe shell structure
Returns
void

◆ get_env_var()

char * get_env_var ( char ** env,
char * var )

Get an environment variable.

Parameters
envThe environment
varThe variable to get
Returns
char * The value of the variable

◆ replace_env_var()

void replace_env_var ( char ** env,
char * name,
char * value )

Replace an environment variable.

Parameters
envThe environment
nameThe name of the variable
valueThe new value
Returns
void

◆ update_path_list()

void update_path_list ( mysh_t * mysh)

Update the path list.

Parameters
myshThe shell structure
Returns
void