1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

Shell: Add the |& construct for piping stderr along with stdout

When |& is typed, stderr will be piped to stdout before the actual
piping happens. This behaves basically like a 2>&1 | (and the
underlying implementation transforms it to that anyway).
This commit is contained in:
sin-ack 2022-07-16 23:09:03 +00:00 committed by Ali Mohammad Pur
parent 57c8677b5c
commit fbf91f41e7
2 changed files with 14 additions and 2 deletions

View file

@ -200,9 +200,9 @@ heredoc_entries :: { .*? (heredoc_entry) '\n' } [each heredoc_entries]
variable_decls :: identifier '=' expression (' '+ variable_decls)? ' '*
| identifier '=' '(' pipe_sequence ')' (' '+ variable_decls)? ' '*
pipe_sequence :: command '|' pipe_sequence
pipe_sequence :: command '|' '&'? pipe_sequence
| command
| control_structure '|' pipe_sequence
| control_structure '|' '&'? pipe_sequence
| control_structure
control_structure[c] :: for_expr