
RUN
LITE5200B User’s Manual, Rev. 0
Freescale Semiconductor
7-53
7.48
RUN
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:
=> setenv test echo
This is a test\;printenv ipaddr\;echo Done.
=> printenv test
test=echo This is a test;printenv ipaddr;echo Done.
=> run test
This is a test ipaddr=10.0.0.99
Done.
=>
You can call run with several variables as arguments, in which case these commands will be executed in
sequence:
=> setenv test2 echo This is another Test\;printenv serial#\;echo Done.
=> printenv test test2
test=echo This is a test;printenv ipaddr;echo Done.
test2=echo This is another Test;printenv serial#;echo Done.
=> run test test2
This is a test
ipaddr=10.0.0.99
Done.
This is another Test
serial#=TQM860LDDBA3-P50.203 10226122 4
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.