diff options
author | Rob Landley <rob@landley.net> | 2012-03-02 20:18:02 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-03-02 20:18:02 -0600 |
commit | 52265e9d360caa10d61ab9689424dc19225a04fd (patch) | |
tree | a61dfe19e9139b8c9670694593831805c8af232c /toys/env.c | |
parent | 03a8f7430ebe694602646873371fdf067b735eb9 (diff) | |
download | toybox-52265e9d360caa10d61ab9689424dc19225a04fd.tar.gz |
Add copyright notice, fluff out help text, use xexec().
Diffstat (limited to 'toys/env.c')
-rw-r--r-- | toys/env.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,4 +1,8 @@ /* vi: set sw=4 ts=4: + * + * env.c - Set the environment for command invocation. + * + * Copyright 2012 Tryn Mirell <tryn@mirell.org> * env.c USE_ENV(NEWTOY(env, "^i", TOYFLAG_USR|TOYFLAG_BIN)) @@ -7,9 +11,11 @@ config ENV bool "env" default y help - usage: env [-i] [FOO=BAR...] [command [option...]] + usage: env [-i] [NAME=VALUE...] [command [option...]] - Set the environment for command invocation + Set the environment for command invocation. + + -i Clear existing environment. */ #include "toys.h" @@ -40,8 +46,7 @@ void env_main(void) if (!command) { char **ep; - for (ep = environ; *ep; ep++) - xputs(*ep); + for (ep = environ; *ep; ep++) xputs(*ep); return; - } else execvp(*command, command); + } else xexec(command); } |