sophiakoulen / minishell

A simplified bash-like shell, with pipes, redirections and variable expansion.
3 stars 1 forks source link

Expansion should be performed just before executing a pipeline #130

Closed sophiakoulen closed 1 year ago

sophiakoulen commented 1 year ago
bash-3.2$ cd cursus42/ && echo *
born2beRoot dockerfiles experiment-path fdf fdf_exemple ft_printf ft_printf-src get_next_line libft libft-src libgnl minishell mlx-tests philosophers pipex pipex-tester pipex2 push-swap push_swap_tester rendu
bash-3.2$ export var="a b c"
bash-3.2$ echo hello && <$var
hello
bash: $var: ambiguous redirect
bash-3.2$

What we should do, instead of calling expand_tree() after parse_tree() before exec_tree(), call expand_pipeline() just before each exec_pipeline() in exec_tree().

sophiakoulen commented 1 year ago

Fixed with 93eba2d8e1b54737ffc891c2b7f0051df7bb6325