sbase/printenv.1
Mattias Andrée 7250fb6968 printenv: exit status is 2 on failure
This provides a reliable and portable way to
test whether an environment variable is defined.

(Of course, if you are using glibc you may get
false positives if you include a = in the query.)

Signed-off-by: Mattias Andrée <maandree@kth.se>
2016-04-20 22:57:40 +01:00

30 lines
496 B
Groff

.Dd 2016-03-30
.Dt PRINTENV 1
.Os sbase
.Sh NAME
.Nm printenv
.Nd print the environment or values of variables
.Sh SYNOPSIS
.Nm
.Op Ar var ...
.Sh DESCRIPTION
.Nm
prints the entire environment as key=value pairs if no
.Ar var
is given. Otherwise,
.Nm
prints only the value of each
.Ar var
one per line in the order specified.
.SH EXIT STATUS
.Bl -tag -width Ds
.It 0
Successful completion.
.It 1
One or more queried variables were not found.
.It > 1
An error occurred.
.El
.Sh SEE ALSO
.Xr env 1