XPipe is a project recreates a simple version of shell pipes (|) in C. It allows you to connect multiple commands, so the output of one command becomes the input of the next, just like in a real shell, It also supports heredoc mode which lets you provide input directly in the terminal.
- Reads input from a file or command.
- Passes the output of one command to the next using pipes.
- Writes the final output to another file.
- Uses system calls like
pipe(),fork(),execve(), andwaitpid()to manage processes and communication.
1|-> Run the following sh cmd:
make2|-> usage example
./pipex infile "cmd1" "cmd2" outfileNOTE:
It works exactly like this in the shell:
< infile cmd1 | cmd2 > outfileThis means:
1_ cmd1 reads from infile
2_ cmd1 sends its output to cmd2 through a pipe
3_ cmd2 writes its final output to outfile
- Remove object files:
make clean- Remove all binaries and object files:
make fclean