Rainbow Electronics QIL-A9260-C11 User Manual

Page 32

Advertising
background image

run - run commands in an environment variable

run var [...] - run the commands in the environment variable(s) 'var'

You can use U-Boot environment variables to store commands and even sequences of commands.
To execute such a command, you use the run command:

QIL-A9260> setenv test echo this is an example\;printenv ipaddr\;echo Done
QIL-A9260> printenv test
test=echo this is an example;printenv ipaddr;echo Done
QIL-A9260> run test
this is an example
ipaddr=192.168.1.100
Done

You can call run with several variables as arguments, in which case these commands will be
executed in sequence:

QIL-A9260> setenv test2 echo this is another example\;printenv ethadrr\;echo Done
QIL-A9260> printenv test test2
test=echo this is an example;printenv ipaddr;echo Done
test2=echo this is another example;printenv ethaddr;echo Done
QIL-A9260> run test test2
this is an example
ipaddr=192.168.1.100
Done
this is another example
ethaddr=00:0D:00:0D:00:AB
Done


If a U-Boot variable contains several commands (separated by semicolon), and one of these
commands fails when you "run" this variable, the remaining commands will be executed anyway. If
you execute several variables with one call to run, any failing command will cause "run" to
terminate, i.e. the remaining variables are not executed.

saveenv - save environment variables to persistent storage

All changes you make to the U-Boot environment are made in RAM only. They are lost as soon as
you reboot the system. If you want to make your changes permanent you have to use the saveenv
command to write a copy of the environment settings to persistent storage, from where they are
automatically loaded during startup:

QIL-A9260> saveenv
Saving Environment to dataflash...

setenv - set environment variables

setenv name value ...

- set environment variable 'name' to 'value ...'

setenv name

Datasheet GSG-00006-A01

32/34

Advertising