1.. SPDX-License-Identifier: GPL-2.0+:
2
3printenv command
4================
5
6Synopsis
7--------
8
9::
10
11    printenv [-a] [name ...]
12    printenv -e [-guid guid][-n] [name]
13
14Description
15-----------
16
17The printenv command is used to print environment or UEFI variables.
18
19\-a
20    Print environment variables starting with a period ('.').
21
22\-e
23    Print UEFI variables. Without -e environment variables are printed.
24
25\-guid *guid*
26    Specify vendor GUID *guid*. If none is specified, all UEFI variables with
27    the specified name are printed irrespective of their vendor GUID.
28
29\-n
30    don't show hexadecimal dump of value
31
32name
33    Variable name. If no name is provided, all variables are printed.
34    Multiple environment variable names may be specified.
35
36Examples
37--------
38
39The following examples demonstrates the effect of the *-a* flag when displaying
40environment variables:
41
42::
43
44    => setenv .foo bar
45    => printenv
46    arch=sandbox
47    baudrate=115200
48    board=sandbox
49    ...
50    stdout=serial,vidconsole
51
52    Environment size: 644/8188 bytes
53    => printenv -a
54    .foo=bar
55    arch=sandbox
56    baudrate=115200
57    board=sandbox
58    ...
59    stdout=serial,vidconsole
60
61    Environment size: 653/8188 bytes
62    =>
63
64The next example shows the effect of the *-n* flag when displaying an UEFI
65variable and how to specify a vendor GUID:
66
67::
68
69    => printenv -e -guid 8be4df61-93ca-11d2-aa0d-00e098032b8c PlatformLangCodes
70    PlatformLangCodes:
71        8be4df61-93ca-11d2-aa0d-00e098032b8c (EFI_GLOBAL_VARIABLE_GUID)
72        BS|RT|RO, DataSize = 0x6
73        00000000: 65 6e 2d 55 53 00                                en-US.
74    => printenv -e -n PlatformLangCodes
75    PlatformLangCodes:
76        8be4df61-93ca-11d2-aa0d-00e098032b8c (EFI_GLOBAL_VARIABLE_GUID)
77        BS|RT|RO, DataSize = 0x6
78    =>
79
80Configuration
81-------------
82
83UEFI variables are only supported if CONFIG_CMD_NVEDIT_EFI=y. The value of UEFI
84variables can only be displayed if CONFIG_HEXDUMP=y.
85
86Return value
87------------
88
89The return value $? is 1 (false) if a specified variable is not found.
90Otherwise $? is set to 0 (true).
91