Minishell
 
Loading...
Searching...
No Matches
Builtins Functions

Implementation of builtins of a shell. More...

Functions

int ft_exit (t_data *data, char **array)
 Function to exit the program.
 
int ft_echo (t_data *data, char **array)
 Echo with -n option OPTIONS : -n : print without the triling newline.
 
int ft_which (t_data *data, char **array)
 Says if the command are built-in commands or not.
 
int ft_export (t_data *data, char **array)
 
int ft_env (t_data *data, char **array)
 
int ft_unset (t_data *data, char **array)
 
int ft_pwd (t_data *data, char **array)
 Print the current working directory.
 
int ft_cd (t_data *data, char **array)
 Implementatin of cd builtin of shell.
 

Detailed Description

Implementation of builtins of a shell.

Function Documentation

◆ ft_cd()

int ft_cd ( t_data * data,
char ** array )

Implementatin of cd builtin of shell.

Parameters
datadata structure
arrayarray of strings
Returns
int 0 OK, 1 otherwise
Here is the call graph for this function:

◆ ft_echo()

int ft_echo ( t_data * data,
char ** array )

Echo with -n option OPTIONS : -n : print without the triling newline.

NOTES : you can add any number of n after -n if you want

Parameters
datadata structure
arrayarray of strings
Returns
int 0 OK, error otherwise

◆ ft_env()

int ft_env ( t_data * data,
char ** array )
Here is the call graph for this function:

◆ ft_exit()

int ft_exit ( t_data * data,
char ** array )

Function to exit the program.

Parameters
datadata structure
arrayargument of the exit function
Returns
int value if argument invalid
Here is the call graph for this function:

◆ ft_export()

int ft_export ( t_data * data,
char ** array )
Here is the call graph for this function:

◆ ft_pwd()

int ft_pwd ( t_data * data,
char ** array )

Print the current working directory.

Returns
int

◆ ft_unset()

int ft_unset ( t_data * data,
char ** array )
Here is the call graph for this function:

◆ ft_which()

int ft_which ( t_data * data,
char ** tokens )

Says if the command are built-in commands or not.

Parameters
datadata structure
tokensarray of strings
Returns
int 1 if not at least one is not built-in, 0 if all strs built-ins