em1e / 42_minishell

A project about creating a simple shell, my own bash
0 stars 1 forks source link

redirections with pipes #19

Open sparklebutt opened 1 month ago

sparklebutt commented 1 month ago

Code for forking was re_factored so that pid_t child is an array of [10] in data struct , this allows for creation of children based on pipe_count which needs to be fixed to mirror pipe_count instead of 10 for testing. This allows us to waitpid(child_i[number]) at the end of our fds loop , which is usefull for executing cat > new | echo hi in the correct order.

Code has been refactored for set array based on old model and new model isnt working well with my version yet, will need an update on this and will need to look into that at a later date.

Today will work on fixing signal so it dosnt show new prompt on the side when pressing cntrl c after cat > new | echo hi. Also , cat > existing | wcho hi needs work, i susupect this is an set_array issue. will fix in own version so that there is a working comparison., i assume it to be a small change. Today will work on ls -l | grep .txt > lol also working correctly , so far it finnishes with grep instead of redirection being handled .

sparklebutt commented 1 month ago

Finished what i set out to do today , using copilot to come up with test cases , pipes and simple redirects seem to work fine , the next step is t check all re directions one by one that they imitate bash, except here doc. I am also waiting on the set_array to be cleaned however i feel like this will be a bit of a challenge until we have a clear working structure for our program. i will utalize the pushed project to work between the two versions to see what can be done at some point.

so cleaning and checking the rest of redirects as a mixture of commands is next . Then this should be ready to push .