-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathminishell.c
More file actions
31 lines (29 loc) · 1.3 KB
/
Copy pathminishell.c
File metadata and controls
31 lines (29 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: esali <esali@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/25 17:45:31 by esali #+# #+# */
/* Updated: 2023/08/12 18:43:48 by esali ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int main(int argc, char **argv, char **env)
{
if (argc != 1 || argv[1] != NULL)
return (0);
create_env(env);
get_data()->executing_cmd = 0;
increase_shlvl();
get_data()->exit = 0;
get_pipe()->stdin = dup(STDIN_FILENO);
get_pipe()->stdout = dup(STDOUT_FILENO);
signal(SIGINT, handle_sigint);
signal(SIGQUIT, handle_sigquit);
get_data()->envp = list_to_array();
while (1)
get_user_input();
return (0);
}