Skip to content

Contents of 42sp's Sixth Project - Reproduce the Behavior of the Pipe Shell Operator

Notifications You must be signed in to change notification settings

ArthurSobreira/42_pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Contents of 42sp's Sixth Project - Reproduce the Behavior of the Pipe Shell Operator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published