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
commit c5d0aa9a44
Notes: sideshowbarker 2024-07-19 05:09:11 +09:00
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