2005-11-01 Samuel Thibault * docs/grub.texi: Added echo command description. * stage2/builtins.c(echo_func): New function. (builtin_echo): New variable. (builtin_table): Added builtin_echo in table. Index: docs/grub.texi =================================================================== RCS file: /cvsroot/grub/grub/docs/grub.texi,v retrieving revision 1.84 diff -u -p -r1.84 grub.texi --- docs/grub.texi 20 Sep 2004 21:55:00 -0000 1.84 +++ docs/grub.texi 1 Nov 2005 16:59:26 -0000 @@ -2667,6 +2667,7 @@ you forget a command, you can run the co * debug:: Toggle the debug flag * displayapm:: Display APM information * displaymem:: Display memory configuration +* echo:: Print a message * embed:: Embed Stage 1.5 * find:: Find a file * fstest:: Test a filesystem @@ -2804,6 +2805,16 @@ synthesized number from various BIOS int at 1MB and going up to the first chipset hole for @dfn{upper memory} (the standard PC @dfn{upper memory} interface is limited to reporting a maximum of 64MB). +@end deffn + + +@node echo +@subsection echo + +@deffn Command echo message @dots{} +Print the @var{message}. Note that placing @key{^G} (ASCII code 7) in the +message will cause the speaker to emit the standard beep sound, which is +useful for visually impaired people. @end deffn Index: stage2/builtins.c =================================================================== RCS file: /cvsroot/grub/grub/stage2/builtins.c,v retrieving revision 1.151 diff -u -p -r1.151 builtins.c --- stage2/builtins.c 15 Feb 2005 22:05:07 -0000 1.151 +++ stage2/builtins.c 1 Nov 2005 16:59:28 -0000 @@ -1010,6 +1010,25 @@ static struct builtin builtin_dump = #endif /* GRUB_UTIL */ +/* echo */ +static int +echo_func (char *arg, int flags) +{ + printf("%s\n", arg); + + return 0; +} + +static struct builtin builtin_echo = +{ + "echo", + echo_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_NO_ECHO, + "echo [MESSAGE ...]", + "Print MESSAGE." +}; + + static char embed_info[32]; /* embed */ /* Embed a Stage 1.5 in the first cylinder after MBR or in the @@ -4818,6 +4837,7 @@ struct builtin *builtin_table[] = #ifdef GRUB_UTIL &builtin_dump, #endif /* GRUB_UTIL */ + &builtin_echo, &builtin_embed, &builtin_fallback, &builtin_find,