This is my solution for the pipex project of the Core Curriculum of 42 school.
This project should recreate all the behavior of the pipe command |.
This includes error messages and error handling.
The error messages this code will print are not a exact recreation of those the pipe command will print.
Every of my error messages will tell you what went wrong and after that the error that is stored in errno i.e.
Command 1 not found: No such file or directory
his code works with all known special cases that i know of i.e.
./pipex pipex.c less /usr/bin/wc output
This will compile the project.
make all
This will compile the project and remove every no longer needed `.o` and `.a` files, so you are only left with your executable called `pipex`.
This will also remove the file called `output` if it exists.
make call
This is an example on what input to give to run the programm "correctly".
./pipex pipex.c less wc output
The output will be the same as if you run
less pipex.c | wc > output
This is how the output of my given example looks like.
As always, if you find mistakes, feel free to open an issue and/or contact me.