From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EV4QL-0002uD-Um for mharc-grub-devel@gnu.org; Thu, 27 Oct 2005 05:51:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EV4QJ-0002q4-2D for grub-devel@gnu.org; Thu, 27 Oct 2005 05:51:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EV4QG-0002nX-1Z for grub-devel@gnu.org; Thu, 27 Oct 2005 05:51:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EV4QF-0002my-Di for grub-devel@gnu.org; Thu, 27 Oct 2005 05:51:47 -0400 Received: from [66.249.82.207] (helo=xproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EV4QF-0006OL-M5 for grub-devel@gnu.org; Thu, 27 Oct 2005 05:51:47 -0400 Received: by xproxy.gmail.com with SMTP id s8so676787wxc for ; Thu, 27 Oct 2005 02:51:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:disposition-notification-to:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=n1E8ID5JdjRyxJFCfD0tUFJO+obXwQXcJddV0W8Ls2TrUxgZnypZYorRkMBf8HDGdcuDPVdj4Uwlq+Eq2F27gi89+/lc/msyS8eCYp0S9CvlGLdg3MIWeFbPap+BgcWrVTYtaVXBdZHVjyuAkGXNyG0s5zkLGNV77F8FjlxifR4= Received: by 10.64.91.7 with SMTP id o7mr1420523qbb; Thu, 27 Oct 2005 02:51:46 -0700 (PDT) Received: from ?192.168.1.100? ( [62.202.53.121]) by mx.gmail.com with ESMTP id q19sm267761qbq.2005.10.27.02.51.44; Thu, 27 Oct 2005 02:51:45 -0700 (PDT) Message-ID: <4360A330.4030808@gmail.com> Date: Thu, 27 Oct 2005 11:51:44 +0200 From: Vladimir Serbinenko User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050804) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <874q78uy4l.fsf@student.han.nl> In-Reply-To: <874q78uy4l.fsf@student.han.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Scripting framework 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: Thu, 27 Oct 2005 09:51:52 -0000 I wrote the scripting support. The patch can be found under http://phcoder.hut1.ru/bash.patch As in this version there is no arithmethic support I added commands true5 and false 5 for testing They return five times true and then false (true5) or inverse (false5) TODO: 1) Positional arguments like $1, $2, ... and $*/$@ 2) Arithmethic module for commands like ((2+3*5)) 3) logical module for commands like [[ -f /boot/vmlinuz ]] 4) break, continue and return commands 5) menu parameters like: menu --default "Linux" { ... } Can anybody propose the way to generate menu entries from loop? What about menu --prepend var=val --prepend val=var ... Then compiler will expand var=val and put it to the begin of menu 6) Regexp recognizer for case command In difference with bash ( and ) are not the word separators. So you have to put spaces around them in case command e.g. case $x in ( 123 ) ....;; ... esac and not case $x in (123) ....;; ... esac The same with functions. e.g. hello ( ) { .. } or hello () { .. } and not hello() { .. } Command select is not done. Menu should be enough. Expansions and arrays are NOT the part of scripting but of split_cmdline and environment and is not made yet Unfortunately I have now no more time. So I send this letter as is. More information will be available in my next letter and on the site. Vladimir 'phcoder' Serbinenko