Pipex is a project that explores the inner workings of UNIX pipes by replicating the behavior of shell piping. The program takes in file inputs and commands and executes them through pipes, mimicking the shell's command execution process.
- Simulates the shell pipeline behavior:
< file1 cmd1 | cmd2 > file2
. - Handles file input and output redirections.
- Supports execution of external commands.
- Proper error handling and memory management.
- Clone the repository:
git clone https://github.com/ejarvinen/42Pipex.git
cd 42Pipex
- Update and initialize submodules:
git submodule init
git submodule update
- Build the project using the Makefile:
make
Run the program with the following syntax:
./pipex file1 "cmd1" "cmd2" file2
This will behave like:
< file1 cmd1 | cmd2 > file2
./pipex infile "ls -l" "wc -l" outfile
Equivalent to:
< infile ls -l | wc -l > outfile