From 6446a8b6a785b8613cd3b2b38d27818ec5d3ca77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Mon, 4 Dec 2023 00:02:35 -0500 Subject: [PATCH] Introduce env.com Handy tool for debugging environment issues. --- examples/env.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/env.c diff --git a/examples/env.c b/examples/env.c new file mode 100644 index 000000000..7fc971663 --- /dev/null +++ b/examples/env.c @@ -0,0 +1,10 @@ +#include "libc/stdio/stdio.h" +#include "libc/runtime/runtime.h" + +int main(int argc, char* argv[]) { + printf("%s\n", argv[0]); + for (char **p = environ; *p; ++p) { + printf(" %s\n", *p); + } + return 0; +}