gachi-mandoo-shell / kimchi-mandoo-shell

a simple shell - minishell 42Seoul-@innovationacademy-kr (jaeskim, yjung)
0 stars 2 forks source link

parse 우선순위 변경 요청 #62

Closed jyw2671 closed 3 years ago

jyw2671 commented 3 years ago
ls | grep l | grep m > file && cat file

위의 경우와 같을때 지금의 로직으로는 cat file이 동작하지 않음(bash에서는 동작) -> 따라서 control_operator을 pipe보다 상위의 개념으로 파싱 필요

JaeSeoKim commented 3 years ago
bash-3.2$ ls | error | echo test > file && cat file 
test
bash-3.2$ ls | echo test > file | error && cat file 
bash-3.2$ 
jyw2671 commented 3 years ago
ls | grep l | grep m > file

pipe 다음에 오는 redirection 처리 수정 필요

JaeSeoKim commented 3 years ago
minishell>ls | grep l | grep m > file
{ 
        PIPE
        left->
        { 
                cmd -> "ls"
                args -> 
        }
        right->
        { 
                PIPE
                left->
                { 
                        cmd -> "grep"
                        args -> 
                        "l"
                }
                right->
                { 
                        redirect-> 2
                        file-> file
                        AST->
                        { 
                                cmd -> "grep"
                                args -> 
                                "m"
                        }
                }
        }
}

어떤 부분이 문제 인가요?

JaeSeoKim commented 3 years ago

parse_line() 에서의 문제점은 없으므로 Close 합니다!