Overview
pipex replicates the behavior of shell pipe commands like < infile cmd1 | cmd2 > outfile. The project teaches process creation, inter-process communication, and file descriptor manipulation at the system call level.
What I Built
- A program that executes two (or more) commands connected by pipes
- Process forking with
fork()and command execution withexecve() - File descriptor redirection using
dup2() - PATH resolution to find command binaries
- Proper error handling and cleanup of child processes
Key Concepts
- How UNIX pipes work:
pipe()creates a unidirectional data channel - Process lifecycle:
fork(),execve(),waitpid() - File descriptor duplication and the fd table
- Environment variable parsing (
PATH) for command resolution - Zombie process prevention and proper exit code propagation