From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Pa4PV-0001JI-0e for mharc-grub-devel@gnu.org; Tue, 04 Jan 2011 05:46:37 -0500 Received: from [140.186.70.92] (port=38124 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa4PR-0001HV-1k for grub-devel@gnu.org; Tue, 04 Jan 2011 05:46:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pa4PO-00041K-Dj for grub-devel@gnu.org; Tue, 04 Jan 2011 05:46:32 -0500 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:36371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pa4PO-00040i-4C for grub-devel@gnu.org; Tue, 04 Jan 2011 05:46:30 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Pa4PL-0003cY-QZ for grub-devel@gnu.org; Tue, 04 Jan 2011 10:46:27 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 4.69) (envelope-from ) id 1Pa4PK-0005T7-MZ for grub-devel@gnu.org; Tue, 04 Jan 2011 10:46:26 +0000 Date: Tue, 4 Jan 2011 10:46:26 +0000 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20110104104626.GA15515@riva.ucam.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Regarding ENV variable X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 10:46:34 -0000 On Mon, Jan 03, 2011 at 07:08:51PM +0530, Gnanasekar Loganathan wrote: > i'm setting environment variable by set mycmd="knetbsd netbsd.g" > > if call my own command, end up with no argument error. > grub> myboot $mycmd > myboot: usage knetbsd > > if do echo $mycmd, getting the correct string > grub> echo $mycmd > knetbsd netbsd.g > > if i directly run, throw unknown command > grub>$mycmd > error: unknown command `knetbsd netbsd.g'. > > How do i pass 2 arguments from single env variable or how to run the > env as command? I don't think this is possible right now. We would need to have some equivalent of the shell 'eval' builtin. The underlying pieces are present (e.g. grub_script_execute_sourcecode) but aren't exposed in the GRUB scripting interface. If you aren't able to add this extension to GRUB script yourself and propose a patch, I suggest reworking your code in some other form. -- Colin Watson [cjwatson@ubuntu.com]