The Pipex project is a program that mimics the behavior of the shell command: <infile cmd1 | cmd2 >outfile
The goal is to implement this functionality in C, leveraging pipes and process management to execute commands in sequence and redirect input/output streams.
The program takes the following format: ./pipex infile cmd1 cmd2 outfile. It performs the equivalent of the shell command: <infile cmd1 | cmd2 >outfile.
A pipe is created to facilitate communication between two commands. The pipe() system call creates a pair of file descriptors: pipe_id[0] for reading and pipe_id[1] for writing. The output of cmd1 is written to pipe_id[1], and cmd2 reads this output from pipe_id[0].
fork() is used to create child processes. execve() executes the commands. If successful, execve() does not return to the calling program. Each command (cmd1, cmd2) requires a separate child process to execute concurrently.
Extract the PATH variable from envp to locate the executable files for the commands. Use this path information to construct the full path for execve().
Actual Status : finished.
If you'd like to contribute to the project, please create a pull request on GitHub. Please adhere to the contribution guidelines outlined in the CONTRIBUTING.md file.
This project is distributed under the MIT License.