On Feb 3, 2008 6:55 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Sun, Feb 03, 2008 at 11:05:26AM +0800, Bean wrote: > > > > > Try the following grub.cfg: > > > > > > > > > > cat (memdisk)/non-existant-file > > > > > echo this point should never be reached > > > > > read > > > > > > > > > > You'll see that the echo is reached, even if cat returned an error. > > > > > > > > > > This becomes much worse when found in situations like: > > > > > > > > > > font (xxx)/some-file.pff > > > > > terminal gfxterm > > > > > > > > > > and the font wasn't loaded. > > > > > > > > Urgh! Bean committed a patch that zero'ed the error. Perhaps it was > > > > wrong? ;-) > > > > > > > > Can you try reverting it? :-) > > > > > > Actually, it was wrong before that. > > > > i think you can use the if statement to test command result. > > You mean it is intentional? I think it's a bad plan to assume user will check > for error status of each command, specially in situations like font/gfxterm.
In fact, the most common error is the font command, as sometimes it can't find the font file from disk. I think you can change the grub.cfg to something like this: if font (xxx)/some-file.pff ; then # graphic mode setting else # text mode setting fi i think this behavior is consistent with sh, an error code returned from command should not cause the script to abort. -- Bean _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel