![Screen Shot 2023-08-20 at 5 57 51 PM](https://private-user-images.githubusercontent.com/32704316/261862800-cc8ba737-c73a-4ddd-a331-8b81dbadb1cf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNjMzNDYsIm5iZiI6MTcyMTM2MzA0NiwicGF0aCI6Ii8zMjcwNDMxNi8yNjE4NjI4MDAtY2M4YmE3MzctYzczYS00ZGRkLWEzMzEtOGI4MWRiYWRiMWNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDA0MjQwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyY2I5YjQwOGQ3MTIxMmNmYzhhOThkZWFhODhmOGFkMjk3M2ZlMWZiNWFkMmRkZTY2OTcxNGIwMGFhNGQ1Y2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VNPpFd3yEpNAK9tfg65ZMI6KrBoDbYgxaMaIl-tuNJw)
The project deals with handling pipes and processes to mimic the piping behaviour of shell.
pipex program takes 4 arguments as below:./pipex file1 cmd1 cmd2 file2
where,• file1 and file2 are file names.
• cmd1 and cmd2 are shell commands with their parameters.
It must behave exactly the same as the shell.
As bonus, I also handle multiple pipes and heredoc feature. For example:
./pipex file1 cmd1 cmd2 cmd3 ... cmdn file2
shell equivalent: < file1 cmd1 | cmd2 | cmd3 ... | cmdn > file2
and heredoc as:
$> ./pipex here_doc LIMITER cmd cmd1 file
shell equivalent: cmd << LIMITER | cmd1 >> file