Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 2.08 KB

README.md

File metadata and controls

69 lines (45 loc) · 2.08 KB

Pipex [125 / 100]

Summary

The sixth project in the 42sp fundamentals track, Pipex, is based on the creation of a program that imitates the shell operator Pipe, which takes the return from one command and passes it to the input of another. The main objective of this project is to introduce the use of multiple processes with forks, file descriptor redirection, execve and more.


Run the Program

  • Make sure you clone the repository with the following command:
$> git clone [email protected]:ArthurSobreira/42_pipex.git
  • Once cloned, to compile the program, use the following commands:
$> make / make bonus

Mandatory Part

  • To run the mandatory part of the program, just have access to an input file (the output file is not necessary, if one does not exist, the program will create it) and execute the following commands:
$> ./pipex infile first_cmd second_cmd outfile

# Should behave like:

$> < infile first_cmd | second_cmd > outfile

Bonus Part

  • To run the bonus part of the program, in which it is possible to execute an indefinite number of pipes, as well as the mandatory part, just have access to an input file and execute the following commands:
$> ./pipex_bonus infile first_cmd second_cmd ... nth_cmd outfile

# Should behave like:

$> < infile first_cmd | second_cmd | ... | nth_cmd > outfile
  • The bonus also allows the use of << >> operators when the first parameter is 'here_doc':
$> ./pipex_bonus here_doc LIMITER first_cmd second_cmd ... nth_cmd outfile

# Should behave like:

$> first_cmd << LIMITER | second_cmd | ... | nth_cmd >> outfile