]> Zhao Yanbai Git Server - minix.git/commitdiff
Wrote a printenv(1)
authorBen Gras <ben@minix3.org>
Mon, 27 Jun 2005 09:41:58 +0000 (09:41 +0000)
committerBen Gras <ben@minix3.org>
Mon, 27 Jun 2005 09:41:58 +0000 (09:41 +0000)
commands/simple/Makefile
commands/simple/printenv.c [new file with mode: 0644]

index 9321b563ccbfe0861aed1bd816924eae19ef2472..f696d0c9e59482e119ae7f8537f6c3c513ee1d73 100755 (executable)
@@ -133,6 +133,7 @@ ALL = \
        prep \
        printf \
        printroot \
+       printenv \
        proto \
        pwd \
        pwdauth \
@@ -574,6 +575,10 @@ printf:    printf.c
        $(CCLD) -o $@ $?
        @install -S 4kw $@
 
+printenv:      printenv.c
+       $(CCLD) -o $@ $?
+       @install -S 4kw $@
+
 printroot:     printroot.c
        $(CCLD) -o $@ $?
        @install -S 4kw $@
@@ -939,6 +944,7 @@ install:    \
        /usr/bin/pr_routes \
        /usr/bin/prep \
        /usr/bin/printf \
+       /usr/bin/printenv \
        /usr/bin/printroot \
        /usr/bin/proto \
        /usr/bin/pwd \
@@ -1340,6 +1346,9 @@ install:  \
 /usr/bin/printf:       printf
        install -cs -o bin $? $@
 
+/usr/bin/printenv:     printenv
+       install -cs -o bin $? $@
+
 /usr/bin/printroot:    printroot
        install -cs -o bin $? $@
 
diff --git a/commands/simple/printenv.c b/commands/simple/printenv.c
new file mode 100644 (file)
index 0000000..3aa7240
--- /dev/null
@@ -0,0 +1,12 @@
+
+#include <stdio.h>
+
+int main(int argc, char *argv[], char *envp[])
+{
+       int p;
+       for(p = 0; envp[p] && *envp[p]; p++) {
+               printf("%s\n", envp[p]);
+       }
+       return 0;
+}
+