public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Capture of the returned value in cmdline
@ 2006-02-08 11:56 do
  2006-02-09  0:43 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: do @ 2006-02-08 11:56 UTC (permalink / raw)
  To: u-boot

Hello,
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?
Is this also possible with standalone programs like examples/hello_world.c?


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[]);

Best regards!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] Capture of the returned value in cmdline
  2006-02-08 11:56 [U-Boot-Users] Capture of the returned value in cmdline do
@ 2006-02-09  0:43 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2006-02-09  0:43 UTC (permalink / raw)
  To: u-boot

In message <dscm94$ovq$1@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-09  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08 11:56 [U-Boot-Users] Capture of the returned value in cmdline do
2006-02-09  0:43 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox