Rainbow Electronics QIL-A9260-C11 User Manual

Page 33

Advertising
background image

- delete environment variable 'name'

To modify the U-Boot environment you have to use the setenv command. When called with exactly
one argument, it will delete any variable of that name from U-Boot's environment, if such a variable
exists. Any storage occupied for such a variable will be automatically reclaimed:

QIL-A9260> setenv foo this is an example value
QIL-A9260> printenv foo
foo=this is an example value
QIL-A9260> setenv foo
QIL-A9260> printenv foo
## Error: "foo" not defined

When called with more arguments, the first one will again be the name of the variable, and all
following arguments will (concatenated by single space characters) form the value that gets stored
for this variable. New variables will be automatically created, existing ones overwritten.

QIL-A9260> printenv usba9263
## Error: "usba9263" not defined
QIL-A9260> setenv usba9263 This is a new example
QIL-A9260> printenv usba9263
usba9263=This is a new example
QIL-A9260>

Remember standard shell quoting rules when the value of a variable shall contain characters that
have a special meaning to the command line parser (like the $ character that is used for variable
substitution or the semicolon which separates commands). Use the backslash (\) character to escape
such special characters.

QIL-A9260> setenv cons_opts console=tty0 console=ttyS0,\$(baudrate)

QIL-A9260> printenv cons_opts

cons_opts=console=tty0 console=ttyS0,$(baudrate)

QIL-A9260>

There is no restriction on the characters that can be used in a variable name except the restrictions
imposed by the command line parser (like using backslash for quoting, space and tab characters to
separate arguments, or semicolon and newline to separate commands). Even strange input like "=-/|
()+=" is a perfectly legal variable name in U-Boot.

A common mistake is to write setenv name=value instead of setenv name value

There will be no error message, which lets you believe everything went OK, but it didn't: instead of
setting the variable name to the value you tried to delete a variable with the name name=value. This
is probably not what you intended. Always remember that name and value have to be separated by
space and/or tab characters.

sspi - SPI utility commands

tftpboot- boot image via network using TFTP protocol

Datasheet GSG-00006-A01

33/34

Advertising