sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 616379f8cacd4883041acc824a0ea2e96a19e26e
parent 22c6502b67b6c607455a71409945de139b6f59e3
Author: FRIGN <dev@frign.de>
Date:   Sat Jan 24 00:22:06 +0100

Add mandoc-manpage for env(1)

and mark it as finished in the README.

Diffstat:
README | 2+-
env.1 | 85++++++++++++++++++++++++++++++++++++++++++-------------------------------------
env.c | 2+-
3 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/README b/README @@ -27,7 +27,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support, =* dirname yes none = du no -H, -L, (-x) =* echo yes none -= env yes none +=* env yes none # expand yes none expr yes none =* false yes none diff --git a/env.1 b/env.1 @@ -1,41 +1,46 @@ -.TH ENV 1 sbase\-VERSION -.SH NAME -env \- modify the environment, then print it or run a command. -.SH SYNOPSIS -.B env -.RB [ \-i ] -.RB [ \-u -.IR name ]... -.RI [ name=value ]... -.RI [ cmd -.RI [ arg ...]] - -.SH DESCRIPTION -.B env -removes part of the environment according to the flags, then adds or -sets each variable specified by -.IR name -to equal -.IR value . - +.Dd January 24, 2015 +.Dt ENV 1 sbase\-VERSION +.Sh NAME +.Nm env +.Nd modify the environment, then print it or run a command +.Sh SYNOPSIS +.Nm env +.Op Fl i +.Oo Fl u Ar variable Oc ... +.Oo Ar variable Ns = Ns Ar value Oc ... +.Oo Ar cmd Oo arg ... Oc Oc +.Sh DESCRIPTION +.Nm +unsets each +.Ar variable , +then adds or sets each +.Ar ( variable , value ) +tuple in the environment. +.Pp If -.IR cmd -is given, it is executed in this new environment; otherwise, the -modified environment is printed to standard out. - -.SH OPTIONS -.TP -.B \-i -Comptetely ignore the existing environment; start fresh. - -.TP -.B \-u name -Unsets -.IR name -from the environment. - -.SH SEE ALSO -.IR printenv (1) -.IR putenv (3) -.IR environ (7) - +.Ar cmd +is given, it is executed in this new environment; +otherwise, the modified environment is printed to stdout. +.Sh OPTIONS +.Bl -tag -width Ds +.It Fl i +Completely ignore the existing environment and execute +.Ar cmd +only with each +.Ar ( variable , value ) +specified. +.El +.Sh SEE ALSO +.Xr printenv 1 , +.Xr putenv 3 , +.Xr environ 7 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2008 +specification. +.Pp +The +.Op Fl u +flag is an extension to that specification. diff --git a/env.c b/env.c @@ -12,7 +12,7 @@ extern char **environ; static void usage(void) { - eprintf("usage: env [-i] [-u name]... [name=value]... [cmd [arg...]]\n"); + eprintf("usage: env [-i] [-u variable] ... [variable=value] ... [cmd [arg ...]]\n"); } int