From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Dhv9c-0002zC-Qs for mharc-grub-devel@gnu.org; Mon, 13 Jun 2005 16:03:28 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dhv9b-0002yU-4S for grub-devel@gnu.org; Mon, 13 Jun 2005 16:03:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dhv4y-0001l7-5J for grub-devel@gnu.org; Mon, 13 Jun 2005 15:58:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dhv4u-0001bY-Fe for grub-devel@gnu.org; Mon, 13 Jun 2005 15:58:36 -0400 Received: from [194.67.23.121] (helo=mx1.mail.ru) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dhun8-0007em-By for grub-devel@gnu.org; Mon, 13 Jun 2005 15:40:14 -0400 Received: from [62.202.63.144] (port=4851 helo=[192.168.1.100]) by mx1.mail.ru with esmtp id 1Dhuly-000CZx-00 for grub-devel@gnu.org; Mon, 13 Jun 2005 23:39:03 +0400 Message-ID: <42ADE0D4.3080508@list.ru> Date: Mon, 13 Jun 2005 21:39:00 +0200 From: Serbinenko Vladimir User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <429C6B12.4080608@inma.ucl.ac.be> <42ABF841.1050706@list.ru> <42ADCBBC.9090705@list.ru> <200506132052.31588.okuji@enbug.org> In-Reply-To: <200506132052.31588.okuji@enbug.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Scripting and keystrokes X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2005 20:03:27 -0000 Yoshinori K. Okuji wrote: >On Monday 13 June 2005 20:09, Serbinenko Vladimir wrote: > > >>Other idea: change menu syntax to select like command (see man bash) but >>instead of prompting for number GRUB will write it to menu. What do you >>think about it? >> >> > >I am too stupid to imagine it. Can you show an example? > > > > I'm sorry that I wrote this letter too fast and w/o examples. Example If you write in normal bash: select x in "Debian Linux" "Gentoo Linux" "Mandrake Linux"; do case "$x" in ("Debian Linux") echo lets boot debian; break;; ("Gentoo Linux") echo lets boot gentoo; break;; ("Mandrake Linux") echo lets drake; break;; esac; done It will show 1) Debian Linux 2) Gentoo Linux 3) Mandrake Linux And ask for number and then execute corresponding entry. If GRUB adapts this syntax it will show menu Debian Linux Gentoo Linux Mandrake Linux ask use to choose and then boot corresponding entry. Disadvantages: You must write two times the name. Advantages: It's close to bash Sub-menus. "dynamic" menus (created by scripts) Easy creating of similar entries select x in "Debian Linux" "Gentoo Linux" "Mandrake Linux network1" "Mandrake Linux network2"; do case "$x" in ("Debian Linux") echo lets boot debian; break;; ("Mandrake Linux "* ) echo lets drake with PROFILE=${x:15}; break;; ("Gentoo Linux") echo lets boot gentoo; break;; esac; done In this case script determines which value to pass in PROFILE variable. Here it's not particularly advantaging but if you have more parameters. like: Mandrake Linux network1 Mandrake Linux network2 Mandrake Linux console network1 Mandrake Linux console network2 Mandrake Linux console nonfb network1 Mandrake Linux console nonfb network2 Mandrake Linux console nonfb failsafe network1 Mandrake Linux console nonfb failsafe network2 Script can check if keywords console, network1, network2, nonfb and failsafe are present and boot corresponding config. Vladimir