2005-16-10 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 -u -p -r1.84 grub.texi --- docs/grub.texi 20 Sep 2004 21:55:00 -0000 1.84 +++ docs/grub.texi 16 Oct 2005 21:43:24 -0000 @@ -2685,6 +2685,7 @@ * module:: Load a module * modulenounzip:: Load a module without decompression * pause:: Wait for a key press +* echo:: Print a message * quit:: Exit from the grub shell * reboot:: Reboot your computer * read:: Read data from memory @@ -3088,6 +3089,16 @@ placing @key{^G} (ASCII code 7) in the message will cause the speaker to emit the standard beep sound, which is useful when prompting the user to change floppies. +@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 -u -p -r1.151 builtins.c --- stage2/builtins.c 15 Feb 2005 22:05:07 -0000 1.151 +++ stage2/builtins.c 16 Oct 2005 21:43:25 -0000 @@ -2983,6 +2983,25 @@ static struct builtin builtin_pause = }; +/* 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." +}; + + #ifdef GRUB_UTIL /* quit */ static int @@ -4848,6 +4867,7 @@ struct builtin *builtin_table[] = &builtin_parttype, &builtin_password, &builtin_pause, + &builtin_echo, #ifdef GRUB_UTIL &builtin_quit, #endif /* GRUB_UTIL */