Skip to content

Haimasker/pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pipex

This project was made in accordance with the project of School 21 (Ecole 42).

GitHub code size in bytes Number of lines of code Code language count GitHub top language


Preamble

The purpose of this project is to simulate UNIX mechanism - pipe.

You can see the subject here: pipex.

Main requirements, rules and code style: Norm.


Description

Mandatory part

  • Our objective is to code pipex that should be executed in this way:
./pipex file1 cmd1 cmd2 file2
  • Execution of pipex should be similar to the next shell command:
< file1 cmd1 | cmd2 > file2

file1, file2 - filenames

cmd1, cmd2 - shell commands with their parameters


  • Handling errors must be like in shell

Bonus part

  • pipex should handle multiple pipes:
./pipex file1 cmd1 cmd2 cmd3 ... cmdn file2

is equivalent to next shell command:

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

  • pipex should support « and » when the first parameter is here_doc:
./pipex here_doc LIMITER cmd1 cmd2 file

is equivalent to next shell command:

cmd1 << LIMITER | cmd2 >> file

Installation and usage

  • Clone this repository:
git clone https://github.com/Haimasker/pipex.git
  • Go to the project folder:
cd pipex
  • To compile mandatory part:
make
  • To compile bonus part:
make bonus
  • After compilation just run pipex with your parameters.