PRINTENV(1) General Commands Manual PRINTENV(1)

printenvlist environment variables

printenv [-0] [variable]…

Writes all variables in the environment in their original format (KEYVALUE) and order, separated by newlines, to the standard output stream.

If variables are specified, writes just their values, in the order specified, separated by newlines.

, --null
Separate lines by NUL characters instead of newlines.

if some of the variables specified didn't exist.

env(1), environ(7)

Appeared, fully formed, in 2BSD as printenv(UCB):

printenv - print out the environment
with a SYNOPSIS of
printenv [ name ]
but only checking that the names with nameprintenv A would write the values of both A and AA.

3BSD fixes this.

AT&T System V Release 4 UNIX includes 3BSD printenv in /usr/ucb.

Multiple variables and -0 are extensions, originating from the GNU system.

November 23, 2022 voreutils pre-v0.0.0-latest