summaryrefslogtreecommitdiff
path: root/tools/envdump.c
diff options
context:
space:
mode:
authorspv <aquaticvegetable@gmail.com>2022-04-20 14:10:27 -0400
committerspv <aquaticvegetable@gmail.com>2022-04-20 14:10:27 -0400
commit7caa231e0b0fa607080586725fbbc9628a1cc031 (patch)
treee22a643aefbc73c703b90f2454c0f75374696399 /tools/envdump.c
hello and welcome back to hell
Diffstat (limited to 'tools/envdump.c')
-rw-r--r--tools/envdump.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/envdump.c b/tools/envdump.c
new file mode 100644
index 0000000..4536d00
--- /dev/null
+++ b/tools/envdump.c
@@ -0,0 +1,17 @@
+#include <unistd.h>
+#include <stdio.h>
+
+int main(int argc, char* argv[], char* envp[]) {
+ char** environ_ = envp;
+
+ FILE* fp = fopen("/tmp/envdump.txt", "w");
+
+ while (*environ_) {
+ fprintf(fp, "%s\n", *environ_);
+ environ_++;
+ }
+
+ fclose(fp);
+
+ return 0;
+} \ No newline at end of file