summaryrefslogtreecommitdiff
path: root/userland/minibox/utilities/sh/ast.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-10-09 13:59:59 +0200
committerAnton Kling <anton@kling.gg>2024-10-09 13:59:59 +0200
commitaabbd212f6ba9a38999ea6e6f478bc8afae677d0 (patch)
treecb05eab3124b5e136ec6e6425e13a6765c50b7a7 /userland/minibox/utilities/sh/ast.c
parent3743da5e714696adc9537eae8134a583f36aa1e6 (diff)
sh: Add support for running commands in the background
Diffstat (limited to 'userland/minibox/utilities/sh/ast.c')
-rw-r--r--userland/minibox/utilities/sh/ast.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/userland/minibox/utilities/sh/ast.c b/userland/minibox/utilities/sh/ast.c
index 64dd725..98f4818 100644
--- a/userland/minibox/utilities/sh/ast.c
+++ b/userland/minibox/utilities/sh/ast.c
@@ -61,6 +61,11 @@ int parse_command(struct TOKEN **token_ptr, struct AST *cur) {
cur->file_out = token->string_rep;
token = token->next;
}
+ // Parse '&'
+ if (token && TOKEN_BACKGROUND == token->type) {
+ cur->should_background = 1;
+ token = token->next;
+ }
// Parse pipe '|'
if (token && TOKEN_PIPE == token->type) {
cur->pipe_rhs = allocate_ast();