From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from msmail.insydesw.com.tw (ms.insydesw.com [211.75.113.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8FC9081F49 for ; Fri, 2 Dec 2016 01:20:18 -0800 (PST) Received: from msmail.insydesw.com.tw ([fe80::74f7:f173:f4aa:9a05]) by msmail.insydesw.com.tw ([fe80::74f7:f173:f4aa:9a05%11]) with mapi id 14.01.0438.000; Fri, 2 Dec 2016 17:20:16 +0800 From: Tim Lewis To: "edk2-devel@lists.01.org" Thread-Topic: [shell] Redirected Environment Variables Are Not Saved Correctly Thread-Index: AdJMeegpfPwnY2z5TwSAYlt9QEtuSw== Date: Fri, 2 Dec 2016 09:20:15 +0000 Message-ID: <7236196A5DF6C040855A6D96F556A53F410DA5@msmail.insydesw.com.tw> Accept-Language: en-US, zh-TW X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.168.100.111] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: [shell] Redirected Environment Variables Are Not Saved Correctly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:20:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Test by doing this, immediately after booting: Notice that echo has created a new environment variable _key to the value 4= , But this variable does not show up when running "set" Why? It is because the FileHandleWrappers does not use SetEnvironmentVariab= le. Instead, it tries to read and write the UEFI variable directly. But thi= s method does not update the internal list of environment variables maintai= ned by the Shell Protocol API. This causes a lot of issues, because the results of any console redirection= to an environment variable is not immediately visible. Tim [cid:image001.png@01D24C37.475327F0]