Reimplementation of UNIX pipes behavior in C.
The pipex project consists of recreating the behavior of UNIX pipes (
|) in C.It executes a series of commands, redirecting the output of one command as the input of the next.
To achieve this,
pipexmakes use of:
- "File descriptors for redirection"
- "Pipes for inter-process communication"
- "
fork()andexecve()for process creation and command execution"
- Handle two-command piping (mandatory part)
- Extend to multiple commands (bonus)
- Support here_doc functionality with a limiter (bonus)
- Correctly manage file redirections (
<,>,>>) - Robust handling of processes and errors
Clone the repository and compile:
git clone https://github.com/hanmpark/pipex.git
cd pipex
make./pipex file1 cmd1 cmd2 file2Equivalent to:
< file1 cmd1 | cmd2 > file2π₯ Bonus β Multiple CommandsEquivalent to:
< file1 cmd1 | cmd2 | cmd3 ... | cmdn > file2./pipex here_doc LIMITER cmd cmd1 fileEquivalent to:
cmd << LIMITER | cmd1 >> file