Skip to content

bruzii/Pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipex

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.

Table of Contents

Features

  • Simulates the behavior of the shell pipe (|) with two commands.
  • Supports input and output redirection.
  • Works on Unix-like systems.

Prerequisites

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.

Installation

  1. Clone the repository:
    git clone ...```
    

Usage

./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.

Examples

Example 1: Using a simple pipe

./pipex infile "ls -l" "grep keyword" outfile

Example 2: Redirecting input/output

./pipex infile "cat" "sort -r" > outfile

Example 3: Using command substitution

./pipex infile "$(cat filelist)" "grep pattern" outfile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published