In the bonus part our objective is to handle multiple pipes and support redirection with here_doc:

How to achieve this (code side):