Skip to content

hanmpark/pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

pipex

Reimplementation of UNIX pipes behavior in C.


Repository created at Repository code size Mostly used language

πŸ“– Description

The pipex project consists of recreating the behavior of UNIX pipes (|) in C.

It executes a series of commands, redirecting the output of one command as the input of the next.

To achieve this, pipex makes use of:

  • "File descriptors for redirection"
  • "Pipes for inter-process communication"
  • "fork() and execve() for process creation and command execution"

πŸ› οΈ Features

  • Handle two-command piping (mandatory part)
  • Extend to multiple commands (bonus)
  • Support here_doc functionality with a limiter (bonus)
  • Correctly manage file redirections (<, >, >>)
  • Robust handling of processes and errors

πŸ“¦ Installation

Clone the repository and compile:

git clone https://github.com/hanmpark/pipex.git
cd pipex
make

πŸš€ Usage

βœ… Mandatory

./pipex file1 cmd1 cmd2 file2

Equivalent to:

< file1 cmd1 | cmd2 > file2

πŸ”₯ Bonus – Multiple Commands

πŸ”₯ Bonus – Multiple Commands

Equivalent to:

< file1 cmd1 | cmd2 | cmd3 ... | cmdn > file2

πŸ”₯ Bonus – here_doc

./pipex here_doc LIMITER cmd cmd1 file

Equivalent to:

cmd << LIMITER | cmd1 >> file

Authors

About

Recreating the UNIX pipes behaviours in C πŸ“‘

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published