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