faboussard / 42_minishell

1 stars 0 forks source link

Si heredoc | heredoc | heredoc, wc compte 1 1 2 au lieu de 0 0 0, et compte TOUJOURS 1 #58

Closed melobern closed 6 months ago

melobern commented 6 months ago
➜  42_minishell.c git:(builtins) ✗ bash
mbernard@z3r8p3:~/sgoinfre/42_minishell.c$ << a wc -l | << b  wc -l | << c wc
> a
> b
> c
      0       0       0
mbernard@z3r8p3:~/sgoinfre/42_minishell.c$ exit
exit
➜  42_minishell.c git:(builtins) ✗ ./minishell 
>>>  Minishell>$ << a wc -l | << b  wc -l | << c cat
a
b
c
1
>>>  Minishell>$ lol
lol: command not found
>>>  Minishell>$ << a wc -l | << b  wc -l | << c cat
a
b
c
1
>>>  Minishell>$ << a wc -l | << b  wc -l | << c cat | cat /tmp/.tmp_heredoc 
a
b 
c
>>>  Minishell>$ << a wc -l | << b  wc -l | << c cat /tmp/.tmp_heredoc 
a
b
c
>>>  Minishell>$ << a wc -l | << b  wc -l | << c wc
a
b
c
      1       1       2
>>>  Minishell>$ << a wc -l | << b  wc -l
a
b
1
>>>  Minishell>$ << a wc -l
a
0
>>>  Minishell>$ 
>>>  Minishell>$ << a wc -l | << b  wc -l
a
un
deux
trois
qutre
cinq
b
1
melobern commented 6 months ago
>>>  Minishell>$ << a | << b | < Makefile wc -l
a
b
0
>>>  Minishell>$ < Makefile wc -l
95
>>>  Minishell>$ << a | < Makefile wc -l
a
0