=== modified file 'docs/grub.texi' --- docs/grub.texi 2010-09-01 09:29:30 +0000 +++ docs/grub.texi 2010-09-04 15:59:27 +0000 @@ -1227,8 +1227,10 @@ The backslash retains its special meaning only when followed by one of the following characters: @samp{$}, @samp{"}, @samp{\}, or newline. A backslash-newline pair is treated as a line continuation (that is, it is -removed from the input stream and effectively ignored). A double quote may -be quoted within double quotes by preceding it with a backslash. +removed from the input stream and effectively address@hidden a +backslash-newline pair within a variable name is not handled properly, so +use this feature with some care.}.). A double quote may be quoted within +double quotes by preceding it with a backslash. @heading Variable expansion @@ -1240,11 +1242,15 @@ Normal variable names begin with an alphabetic character, followed by zero or more alphanumeric characters. -Positional variable names consist of one or more digits. These are reserved -for future expansion. +Positional variable names consist of one or more digits. They represent +parameters passed to function calls, with @samp{$1} representing the first +parameter, and so on. The special variable name @samp{?} expands to the exit status of the most -recently executed command. +recently executed command. When positional variable names are active, other +special variable names @samp{@@}, @samp{*} and @samp{#} are defined and they +expand to all positional parameters with necessary quoting, positional +parameters without any quoting, and positional parameter count respectively. @heading Comments @@ -1305,6 +1311,38 @@ @xref{menuentry}. @end table address@hidden Built-in Commands + +Some built-in commands are also provided by GRUB script to help script +writers perform actions that are otherwise not possible. For example, these +include commands to jump out of a loop without fully completing it, etc. + address@hidden @asis address@hidden break address@hidden +Exit from within a @code{for}, @code{while}, or @code{until} loop. If address@hidden is specified, break @code{n} levels. @code{n} must be greater than +or equal to 1. If @code{n} is greater than the number of enclosing loops, +all enclosing loops are exited. The return value is 0 unless @code{n} is +not greater than or equal to 1. + address@hidden continue address@hidden +Resume the next iteration of the enclosing @code{for}, @code{while} or address@hidden loop. If @code{n} is specified, resume at the @code{n}th +enclosing loop. @code{n} must be greater than or equal to 1. If @code{n} +is greater than the number of enclosing loops, the last enclosing loop (the +``top-level'' loop) is resumed. The return value is 0 unless @code{n} is +not greater than or equal to 1. + address@hidden shift address@hidden +The positional parameters from @code{n}+1 ... are renamed to @code{$1}... . +Parameters represented by the numbers @code{$#} down to @address@hidden +are unset. @code{n} must be a non-negative number less than or equal to address@hidden If @code{n} is 0, no parameters are changed. If @code{n} is not +given, it is assumed to be 1. If @code{n} is greater than @code{$#}, the +positional parameters are not changed. The return status is greater than +zero if @code{n} is greater than @code{$#} or less than zero; otherwise 0. + address@hidden table @node Embedded configuration @section Embedding a configuration file into GRUB