sh: add POSIX-like -c support and complete shell subset gaps

Implement sh -c COMMAND [NAME [ARG...]] in /bin/sh, add shell function
declarations/invocation support, expand export semantics (NAME, NAME=value, -p),
and make until/loop-control behavior available by default. Add focused shell
tests and update sh man-page option docs.
This commit is contained in:
Raven Scott
2026-04-26 15:28:29 -04:00
parent 9471788f6b
commit 4cdd1569af
12 changed files with 490 additions and 38 deletions
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"generatedAt": "2026-04-26T19:04:18.469Z",
"generatedAt": "2026-04-26T19:19:08.715Z",
"pages": [
{
"name": "agent",
@@ -3211,8 +3211,13 @@
"synopsis": [
"sh [OPTION]... [OPERAND]..."
],
"description": "Runs a shell script file line-by-line via ctx.execLine (same language as the interactive booter shell). This is not the interactive REPL; see man bare-os-shell for session builtins, pipelines, and jobs.",
"options": [],
"description": "Runs shell commands via ctx.execLine (same language as the interactive booter shell). Supports command-string mode (`-c`) and script-file mode (`sh SCRIPT`). This is not the interactive REPL; see man bare-os-shell for session builtins, pipelines, and jobs.",
"options": [
{
"flag": "-c COMMAND [NAME [ARG ...]]",
"meaning": "Execute command string and set positional parameters for that command context."
}
],
"keywords": [
"sh",
"bare-os",