Summary: This project will let you discover in detail a UNIX mechanism that you already know by using it in your program.
Goals: This project aims to make you understand a bit deeper two concepts that you already know: the redirections and the pipes. It is an introduction project.
Program name | pipex |
Turn in files | Makefile, *.h, *.c, maps |
Makefile | NAME, all, clean, fclean, re |
External functs. |
|
Libft authorized | Yes |
Description | This project is about handling pipes. |
ย
pipex
, an emulation program of <
, |
, >
, heredoc
, <<
, and >>
in CLI, executes shell commands passed as arguments and redirects the result to the other file.
gcc -o pipex *.c -Llibft -lft
git clone
the repository and execute the make
command inside the cloned directory.
$ ./pipex <file1> <cmd1> <cmd2> ... <cmdn> <file2>
# Works as $ < <file1> <cmd1> | <cmd2> > file2
$ ./pipex here_doc <LIMITER> <cmd1> <cmd2> <file>
# Works as $ <cmd1> << <LIMITER> | <cmd2> >> <file>
./pipex infile "grep foo" "wc -l" outfile
./pipex infile cat cat cat cat cat outfile
./pipex here_doc END "grep foo" "wc -l" outfile
Please connect with me on LinkedIn or send an e-mail.