Add mandoc-manpage for env(1)

and mark it as finished in the README.
This commit is contained in:
FRIGN 2015-01-24 00:22:06 +01:00
parent 22c6502b67
commit 616379f8ca
3 changed files with 47 additions and 42 deletions

2
README
View File

@ -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

85
env.1
View File

@ -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.

2
env.c
View File

@ -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