Implementation of builtins of a shell.
More...
|
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.
|
|
Implementation of builtins of a shell.
◆ ft_cd()
int ft_cd |
( |
t_data * | data, |
|
|
char ** | array ) |
Implementatin of cd builtin of shell.
- Parameters
-
data | data structure |
array | array of strings |
- Returns
- int 0 OK, 1 otherwise
◆ 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
-
data | data structure |
array | array of strings |
- Returns
- int 0 OK, error otherwise
◆ ft_env()
int ft_env |
( |
t_data * | data, |
|
|
char ** | array ) |
◆ ft_exit()
int ft_exit |
( |
t_data * | data, |
|
|
char ** | array ) |
Function to exit the program.
- Parameters
-
data | data structure |
array | argument of the exit function |
- Returns
- int value if argument invalid
◆ ft_export()
int ft_export |
( |
t_data * | data, |
|
|
char ** | array ) |
◆ 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 ) |
◆ ft_which()
int ft_which |
( |
t_data * | data, |
|
|
char ** | tokens ) |
Says if the command are built-in commands or not.
- Parameters
-
data | data structure |
tokens | array of strings |
- Returns
- int 1 if not at least one is not built-in, 0 if all strs built-ins