JonasGoetz01 / 42-minishell

Built your very own shell, Minishell! Explore executing commands, managing history, and controlling inputs and outputs. Dive into handling processes and files while creating a user-friendly shell interface. Get hands-on with shell scripting in a fun and accessible way with Minishell (DONT PANIC SHELL)!
1 stars 1 forks source link

>tmp_out | echo 1 does not get split #316

Closed PaulicStudios closed 5 months ago

PaulicStudios commented 6 months ago

>tmp_out | echo 1 should execute like > tmp_out | echo 1

PaulicStudios commented 6 months ago

should be related to /bin/echo >/dev/null 1 | /bin/echo 2

should be splitted up into the right tokens not into one

/workspaces/42-minishell ❯ /bin/echo >/dev/null 1 | /bin/echo 2
Tokens:
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 5, Value: >, BE-Value: (null)
Type: 0, Value: /dev/null, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 1, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 8, Value: |, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 2, BE-Value: (null)
Tokens:
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 5, Value: >, BE-Value: (null)
Type: 0, Value: /dev/null, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 1, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 8, Value: |, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 2, BE-Value: (null)
Tokens:
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 5, Value: >, BE-Value: (null)
Type: 0, Value: /dev/null, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 1, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 8, Value: |, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 2, BE-Value: (null)
Tokens:
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: >/dev/null, BE-Value: (null)
Type: 15, Value:  , BE-Value: (null)
Type: 0, Value: 1, BE-Value: (null)
Type: 8, Value: |, BE-Value: (null)
Type: 0, Value: /bin/echo, BE-Value: (null)
Type: 0, Value: 2, BE-Value: (null)
Type: 0, Value: /bin/echo Prio: 1
Type: 0, Value: 2 Prio: 1
Type: 8, Value: | Prio: 3
Type: 0, Value: /bin/echo Prio: 1
Type: 15, Value:   Prio: 1
Type: 0, Value: >/dev/null Prio: 1
Type: 15, Value:   Prio: 1
Type: 0, Value: 1 Prio: 1
-----
Type: 16, Value: /bin/echo Prio: -1
Type: 13, Value: /bin/echo2 Prio: -1
Type: 8, Value: | Prio: 3
Type: 13, Value: /bin/echo Prio: -1
Type: 15, Value:   Prio: -1
Type: 14, Value: >/dev/null Prio: -1
Type: 15, Value:   Prio: -1
Type: 14, Value: 1 Prio: -1
executing /bin/echo: in -1 out 4
executing /bin/echo2: in 3 out -1
minishell: /bin/echo2: No such file or directory
waiting for /bin/echo2...
waiting for /bin/echo...
PaulicStudios commented 6 months ago

also probably to ls >"./outfiles/outfile""1""2""3""4""5" should interpret > as an out file