feat: extend alarmdefault and argecho

This commit is contained in:
dualfroz committed 2026-09-08 21:28:10 +02:00
1 parent 4dee5e3009
commit 09239a27e8
5 files changed
+149

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#include "ulib.h"
/*
* Real ring-3 proof that shell.c's `$NAME`/`$?` expansion (shellExpandArgv,
* shellExpandToken) genuinely reaches a SPAWNED program's own argv, not
* just a shell builtin's -- every earlier consumer of expansion (export,
* env, echo) is a builtin, and shell.c's doEcho never calls shellExpandArgv
* at all (only runProgram/runPipelineStages do, for a real spawned
* process), so nothing in this kernel's live-demo chain had ever actually
* typed a `$` at the real shell before this program existed. Prints each
* argv[1..argc) on its own line, prefixed like globcat.c's own
* "globcat: " diagnostic style -- a generic argv printer, not tied to any
* one variable, so a future demo can reuse it for any other `$NAME`/`$?`
* case without needing yet another single-purpose binary.
*/
int main(int argc, char** argv)
{
for (int i = 1; i < argc; i++) {
print("argecho: ");
print(argv[i]);
print("\n");
}
return 0;
}