Pipex is a program that simulates the behavior of the shell pipe (|
) in Unix-like systems. It takes two commands as input and redirects the output of the first command as input to the second command, just like the shell pipe.
- Simulates the behavior of the shell pipe (
|
) with two commands. - Supports input and output redirection.
- Works on Unix-like systems.
Before you begin, ensure you have met the following requirements:
- Your system should be running a Unix-like operating system (e.g., Linux or macOS).
- You should have a C compiler (e.g., GCC) installed on your system.
- Clone the repository:
git clone ...```
./pipex file1 cmd1 cmd2 file2
file1: Input file whose content will be passed as input to cmd1.
cmd1: The first command to run.
cmd2: The second command to run.
file2: Output file where the result will be stored.
./pipex infile "ls -l" "grep keyword" outfile
./pipex infile "cat" "sort -r" > outfile
./pipex infile "$(cat filelist)" "grep pattern" outfile