[U-Boot] [BUG] cmd : Local Hush Variable Could not be deleted

Hi,
+ u-boot version:2019.10 + H/W Board : Beaglebone Black
With 'localvar=' at the shell prompt , I tried to delete a existing Hush-shell local variable.
----------------------------------------------------- => localvar=hello => showvar HUSH_VERSION=0.01 target=pxe devnum=1 localvar=hello => localvar= => showvar HUSH_VERSION=0.01 target=pxe devnum=1 localvar=hello ------------------------------------------------------
The 'localvar' still exists and is not deleted. How do I delete a hush-shell local variable??
-Adarsh
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Dear Adarsh Babu Kalepalli,
In message CAJgxa7c150OvA0bHPROWuizG+DvLrReRbqAoJ96QXkwhhhZsug@mail.gmail.com you wrote:
How do I delete a hush-shell local variable??
You cannot. Local variables can be set to an empty value, but they cannot be deleted.
Note that there is no functional difference between a non-existing local variable and one with an empty value anyway. Same as in other shells.
Best regards,
Wolfgang Denk

Hello Wolfgang Denk,
=> localvar= => showvar HUSH_VERSION=0.01 target=pxe devnum=1 localvar=hello
When 'localvar' is assigned an empty value , the 'showvar' command displays the previously assigned 'hello'.
How do we set an empty value to a hush shell local variable ??
Regards, Adarsh
On Mon, Oct 14, 2019 at 3:58 PM Wolfgang Denk wd@denx.de wrote:
Dear Adarsh Babu Kalepalli,
In message < CAJgxa7c150OvA0bHPROWuizG+DvLrReRbqAoJ96QXkwhhhZsug@mail.gmail.com> you wrote:
How do I delete a hush-shell local variable??
You cannot. Local variables can be set to an empty value, but they cannot be deleted.
Note that there is no functional difference between a non-existing local variable and one with an empty value anyway. Same as in other shells.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Carelessly planned projects take three times longer to complete than expected. Carefully planned projects take four times longer to complete than expected, mostly because the planners expect their planning to reduce the time it takes.

Dear Adarsh,
In message CAJgxa7d3UPKdNcqegTE1ipOrBpx8jY4Q1MMyuWXQeKvTUbbGrQ@mail.gmail.com you wrote:
=> localvar= => showvar HUSH_VERSION=0.01 target=pxe devnum=1 localvar=hello
When 'localvar' is assigned an empty value , the 'showvar' command displays the previously assigned 'hello'.
Sorry, I missed that detail.
How do we set an empty value to a hush shell local variable ??
You are right, this is a real bug. Not even using an explicit empty string argument does work here:
U-Boot> foo=hello U-Boot> showvar HUSH_VERSION=0.01 foo=hello U-Boot> foo='' U-Boot> showvar HUSH_VERSION=0.01 foo=hello
Best regards,
Wolfgang Denk
participants (2)
-
Adarsh Babu Kalepalli
-
Wolfgang Denk