1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Shell: Allow commands in variables, and properly substitute them on use

This allows the below interaction to work:
```
$ silence=(2>&1 >/dev/null)
$ do_noisy_thing with these args $silence
<nothing here lol>
```
This commit is contained in:
AnotherTest 2020-06-22 15:37:20 +04:30 committed by Andreas Kling
parent 42304d7bf1
commit c5d0aa9a44
5 changed files with 161 additions and 68 deletions

View file

@ -107,6 +107,7 @@ sequence :: variable_decls? pipe_sequence ';' sequence
| variable_decls? pipe_sequence
variable_decls :: identifier '=' expression (' '+ variable_decls)? ' '*
| identifier '=' '(' pipe_sequence ')' (' '+ variable_decls)? ' '*
pipe_sequence :: command '|' pipe_sequence
| command