diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-02-24 18:23:18 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-02-24 18:23:18 -0500 |
| commit | 928f3250b3914c88d105d8cf297c6b27a96ed5ad (patch) | |
| tree | 82ef5da0bb54dee76a8191e7c94c5c58cdc4f28a /stdlib/shell.c | |
| parent | 39295176a210df2a1014ac1fe51160ca0a489d5d (diff) | |
Add $Shell:execute()
Diffstat (limited to 'stdlib/shell.c')
| -rw-r--r-- | stdlib/shell.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/shell.c b/stdlib/shell.c index 593301a2..08898acc 100644 --- a/stdlib/shell.c +++ b/stdlib/shell.c @@ -75,6 +75,12 @@ public OptionalText_t Shell$run(Shell_t command) return Text$from_bytes(bytes); } +public int32_t Shell$execute(Shell_t command) +{ + const char *cmd_str = Text$as_c_string(command); + return system(cmd_str); +} + static void _line_reader_cleanup(FILE **f) { if (f && *f) { |
