NataliaMedeiros / minishell

0 stars 0 forks source link

Implementar heredoc edge case #1

Closed NataliaMedeiros closed 1 month ago

NataliaMedeiros commented 1 month ago

Rewrite the part that handles heredoc to deal with more than one limiter on heredoc. For example: cat << lim1 << lim2 << lim3 In this example, it should create 3 heredoc (lim1, lim2 and lim3). The heredoc should close only when all limiters are typed in the terminal. The cat command should take what was typed in between lim2 and lim3.

The idea is to implement a linked list to have all delimiters taking into consideration. In order to do it, both, the heredoc (<<) and infile (>) should be saved on this lined list structure (they could have different implementation, but on the same struct). The reason to make that is to keep the clear execution order on the structure and manage the exceptions.

NataliaMedeiros commented 1 month ago

The heredoc implementation working well. I tested with the tools I have now but I would like to make further tests later. The only thing missing is delete the files created when they are necessary anymore. But I think this implementation should be on heredoc, so I will create a issue to that.