Skip to content

This project is the discovery in detail and by programming of a UNIX mechanism that you already know.

Notifications You must be signed in to change notification settings

edmarpaulino/pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipex

This project is the discovery in detail and by programming of a UNIX mechanism that you already know.

In this repo you will find all the codes developed during the pipex project, both mandatory's part and bonus.


Final score

edpaulin's

Completed + Bonus

edpaulin's

Mandatory

In the Pipex project we should simulate the same behavior as the pipe on unix systems with output redirection.

• Pipex program should be executed in this way:

$> ./pipex file1 cmd1 cmd2 file2

Just in case: file1 and file2 are file names, cmd1 and cmd2 are shell commands with their parameters. The execution of the pipex program should do the same as the next shell command:

$> < file1 cmd1 | cmd2 > file2

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

should be the same as

$> < infile ls -l | wc -l > outfile

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

should be the same as

$> < infile grep a1 | wc -w > outfile

Bonus

• Handle multiple pipes:

$> ./pipex file1 cmd1 cmd2 cmd3 ... cmdn file2

Must be equivalent to:

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

• Support « and » when the first parameter is "here_doc"
$> ./pipex here_doc LIMITER cmd cmd1 file

Must be equivalent to:

$> cmd << LIMITER | cmd1 >> file

Usage

Requirements

This project requires cc compiler.

Instructions

Clone this repository in your local computer:

git clone https://github.com/edmarpaulino/pipex.git

In your local repository, run make

make 

make suports 6 flags:

  • make all or simply make compiles the project mandatory's part
  • make bonus compiles the bonus part
  • make clean deletes the .o files generated during compilation
  • make fclean deletes the .o and the libft.a executable file
  • make re executes fclean and all in sequence
  • make rebonus executes fclean and bonus in sequence

To run the program see Mandatory and bonus examples section above.

About

This project is the discovery in detail and by programming of a UNIX mechanism that you already know.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published