Skip to contentSkip to conversation

Read line from console

U-Boot Eric Nelson 2 participants 3 messages Feb 11, 2014 – Feb 13, 2014

lore
Share & tools
lore
#0 lore raw

Hi all,

I have a n00b question.

Is there any facility for reading a line of text from the console, so we can prompt a user?

I feel certain there must be a way to read a string into a variable, but can't seem to find one...

Please advise,

Eric

#1 lore raw

Dear Eric,

Quoted 3 lines · In message <[email protected]> you wrote:

Is there any facility for reading a line of text from the console, so we can prompt a user?

Do you mean in C code, or as CLI command?

Quoted 2 lines

I feel certain there must be a way to read a string into a variable, but can't seem to find one...

The first would be readline(), the second "env ask" (or "askenv").

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Hindsight is an exact science.
#2 lore raw

Thanks Wolfgang,

Quoted 9 lines · Wolfgang Denk

Dear Eric,

Quoted 3 lines · In message <[email protected]> you wrote:

Is there any facility for reading a line of text from the console, so we can prompt a user?

Do you mean in C code, or as CLI command?

CLI command.

Quoted 5 lines
Quoted 2 lines

I feel certain there must be a way to read a string into a variable, but can't seem to find one...

The first would be readline(), the second "env ask" (or "askenv").

Perfect.

And now that I know what I'm looking for, well documented!

Regards,

Eric