-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipex.c
More file actions
37 lines (34 loc) · 1.39 KB
/
Copy pathpipex.c
File metadata and controls
37 lines (34 loc) · 1.39 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
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipex.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mrhyhorn <mrhyhorn@student.21-school.ru +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/06 18:28:26 by mrhyhorn #+# #+# */
/* Updated: 2022/06/14 22:08:01 by mrhyhorn ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
int main(int argc, char **argv, char **envp)
{
t_data data;
int status;
status = 0;
if (argc < 5)
{
ft_putstr_fd("Too few arguments. ", 2);
ft_puterror("Try this: ./pipex file1 cmd1 cmd2 file2\n");
}
else if (argc > 5)
{
ft_putstr_fd("Too many arguments. ", 2);
ft_puterror("Try this: ./pipex file1 cmd1 cmd2 file2\n");
}
ft_init_struct(&data);
ft_open_files(argv, &data);
ft_parse_cmds(envp, argv, &data);
status = ft_exec(&data, envp, status);
ft_main_free(&data);
return (status);
}