Skip to content
/ pipex Public

Pipex is a C programming project that simulates the behavior of shell command piping.

Notifications You must be signed in to change notification settings

lrafa3l/pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pipex

Description

Pipex is a C program that mimics the behavior of shell commands when handling pipes. It takes four arguments, representing two files and two shell commands with their parameters, and behaves exactly like the shell command:

< file1 cmd1 | cmd2 > file2

This project is designed to give an understanding of how pipes work in Unix-like operating systems.

Usage

Compile the program using the Makefile and run it as follows:

./pipex file1 cmd1 cmd2 file2
  • file1: The name of the input file.
  • cmd1: The first command to be executed with its parameters.
  • cmd2: The second command to be executed with its parameters.
  • file2: The name of the output file.

Example

$> ./pipex infile "ls -l" "wc -l" outfile

This is equivalent to the shell command:

< infile ls -l | wc -l > outfile

Another example:

$> ./pipex infile "grep a1" "wc -w" outfile

Equivalent to:

< infile grep a1 | wc -w > outfile

About

Pipex is a C programming project that simulates the behavior of shell command piping.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published