-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminishell.c
43 lines (39 loc) · 1.37 KB
/
minishell.c
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
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: taehkim2 <taehkim2@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/15 12:12:56 by taehkim2 #+# #+# */
/* Updated: 2023/12/15 18:48:53 by taehkim2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int g_signal;
int main(int argc, char **argv, char **envp)
{
char *line;
t_list *list;
t_pipe pipes;
struct termios terminal;
(void)argc;
(void)argv;
minishell_init(&pipes, &terminal, envp);
while (1)
{
interactive_mode();
line = line_creat(&(pipes.status));
if (line != NULL)
{
add_history(line);
list = parse(line, envp, pipes.status);
free(line);
if (list != NULL)
{
execute(list, &pipes, envp, &terminal);
list_free(&list);
}
}
}
}