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.
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
• 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
This project requires cc compiler.
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 simplymake
compiles the project mandatory's partmake bonus
compiles the bonus partmake clean
deletes the.o
files generated during compilationmake fclean
deletes the.o
and thelibft.a
executable filemake re
executesfclean
andall
in sequencemake rebonus
executesfclean
andbonus
in sequence
To run the program see Mandatory and bonus examples section above.