From: Ben Gras Date: Mon, 27 Jun 2005 09:41:58 +0000 (+0000) Subject: Wrote a printenv(1) X-Git-Tag: v3.1.0~696 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.log?a=commitdiff_plain;h=53a51816a38f720747ad8b8babef04d9bb085259;p=minix.git Wrote a printenv(1) --- diff --git a/commands/simple/Makefile b/commands/simple/Makefile index 9321b563c..f696d0c9e 100755 --- a/commands/simple/Makefile +++ b/commands/simple/Makefile @@ -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 index 000000000..3aa724087 --- /dev/null +++ b/commands/simple/printenv.c @@ -0,0 +1,12 @@ + +#include + +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; +} +