[U-Boot-Users] Capture of the returned value in cmdline

Wolfgang Denk wd at denx.de
Thu Feb 9 01:43:15 CET 2006


In message <dscm94$ovq$1 at sea.gmane.org> you wrote:
>
> Is this possible to capture value returned by the function, which 
> implement some command (for example do_printenv),
> from commandline in u-boot and for example write it to some shell variable?

No, but you can evaluate the return code (especially if  you  enabled
the HUSH shell as command line parser).

> Is this also possible with standalone programs like examples/hello_world.c?

Same here.

> By the way, what is the usage/application of the flag argument in 
> command function declaration, for example:
> int do_printenv(cmd_tbl_t * cmdtp, int flag, int argc, char * argv[]);

See do_run() and run_command() in common/main.c

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Documentation is like sex: when it is good, it is  very,  very  good;
and when it is bad, it is better than nothing.         - Dick Brandon




More information about the U-Boot mailing list