pipex

Executing Unix processes in C.

Pipex - Visualisação do pipe (3)

Pipex's goal is to replicate the behaviour of the pipe operator (|) in a Bash command line. To get there, one must learn about the exec* function family, forking and waiting on child processes, and file redirection with the dup* function family, going as far as managing whitespaces and single/double quotes on the incoming arguments. Such a blast!

Due to the beginner nature of this project (moving forward in the curriculum we have to code our own mini-shell!), when calling the ./pipex program one must pass the arguments following a specific order:

./pipex "input_file" "cmd1 -flags" "cmd2 -flags" ... "cmdN -flags" "output_file"

which holds equivalence to the original bash command:

< input_file cmd1 -flags | cmd2 -flags | ... | cmdN -flags > output_file

Final note

If you're a 42 student struggling to understand this project, I got your back! Please refer to this Notion page that I wrote covering the general concepts related to this project! It's in Portuguese 🌵

Acelera — Pipex