The Pipex project is focused on handling pipes in a Unix-like shell environment. The program is designed to execute a sequence of shell commands, similar to the pipeline operator (|) in a shell, by taking input from one file, processing it through two shell commands, and then writing the result to another file. The goal is to implement a program that simulates the behavior of the shell command line, redirecting the output of one command as input to another.
- Clone the repository and build the executable:
git clone https://github.com/leilatdantas/42CommonCore-pipex.git
cd 42CommonCore-pipex
make
The pipex program takes four arguments:
./pipex file1 cmd1 cmd2 file2
file1: Input file whose content will be processed by cmd1.
cmd1: First command to be executed.
cmd2: Second command to be executed.
file2: Output file where the result will be saved.
./pipex infile "ls -l" "wc -l" outfile
This example executes the commands ls -l and wc -l in sequence, where the output of the first command is used as the input for the second command.