Re: Grub: can grub execute a script/batch file?

From: Sean Cleary (
Date: 10/07/04

Date: 7 Oct 2004 07:06:49 -0700

Paul Lutus <nospam@nosite.zzz> wrote in message news:<>...
> Sean Cleary wrote:
> > Grub: can grub execute a script/batch file?
> > Can grub execute a shell command?
> > Since Grub is likely to be part of the source code, can I enhance it
> > so that it can do either one of these?
> > I need Grub to copy a file over another.
> Explain what you want to do. You almost certainly do not need to do it with
> Grub.

This is a follow on question from the thread before.
I want to copy a file (grub.0 or grub.1) into grub.conf upon using
Grub. The object of this is to change the subsequent grub.conf to the
file that contains the default choice that is a match for the choice
chosen. Example: if grub.0 contains the default=0 line and this
corresponds to Linux, when I chose Linux I want this file copied to
Grub.conf. And when I chose DOS I want the grub.1 file containing the
line default=1 (and other lines of the grub.conf file) to be copied
over the Grub.conf file. As I said in the other thread, if this was
DOS and autoexec.bat/config.sys, this would be a way to do this.
Likewise, if a direct copy can not be done, doing a script or shell
command file may be able to be done. The major problem I would face is
that there is not a shell at the time that Grub runs.


Relevant Pages

  • Re: Howto fix grub after converting to reiserfs
    ... First, to rephrase a bit of what shell says the problem is, highly simplified. ... The initial load of grub is done by the BIOS, which reads the boot sectors for additional information for the boot process. ... If you still have problems, and can come up with a small bit of additional disk space, near the beginning of the disk, create a separate partition for /boot and format it as ext3, move all the files from your existing subdirectory into this new partition, edit the menu.lst file to remove all references to '/boot', edit fstab to do a mount of this partition on /boot, and reboot. ... it will perform a full install presuming the Stage 2 or Stage 1.5^10 is in its final install location. ...
  • Re: Grub: can grub execute a script/batch file?
    ... One needs a shell to run shell scripts. ... >> Grub. ... I suspect that you are asking for AFTER a boot with grub to force ...
  • Re: Ubuntu security hole? (not super major, but wondering if it is an issue to report)
    ... to drop to a shell in case of an error. ... Then grub could be configured ... Keyboard/mouse/monitor access does not imply removable media access. ... I have worked where most programmers had keyboard/mouse/monitor remote access ...
  • Re: Re: Help required
    ... but is this encrypted password of the general user that i login with, ... this password is ONLY for accessing and editing Grub on boot ... when we get the encrypted password while typing the command ... each time if typing the 'md5crpty' command in the grub shell ...
  • Re: Help: GRUB tab completion not working
    ... : echo $SHELL ... Outside of the grub shell: ... lists possible command completions. ...