The pipex program is a executable for the `pipe` shell command, where you can redirect the output of some commands to the input of others.
pipex must:
- read and write from/to files;
- redirect single pipes and truncate existing file output.
Header files
Main file
Utilities
Error management and program closing
pipex
requires a clang compiler and some standard libraries.
Clone this repository in your local computer:
$> git clone https://github.com/lmoraesdev/pipex.git path/to/pipex
In your local repository, run make
$> make
make
suports 6 flags:
make all
or simplymake
compiles pipex in its mandatory formatmake bonus
compiles pipex in its bonus formatmake clean
deletes the.o
files generated during compilationmake fclean
deletes the.o
and thepipex
file generatedmake re
executesfclean
andall
in sequence, recompiling the programmake rebonus
executesfclean
andbonus
in sequence, recompiling the program with the bonus functions
To run pipex
, type:
./pipex files/<choose-input-file> cmd1 cmd2 files/<choose-output-file>
# works like:
< files/<choose-input-file> cmd1 | cmd2 > files/<choose-output-file>
For bonus' here_doc option, type:
./pipex here_doc LIMITER cmd1 cmd2 files/<choose-output-file>
# works like:
cmd1 << LIMITER | cmd2 >> files/<choose-output-file>
./pipex
also works with multiple pipes.