* Regarding ENV variable
@ 2011-01-03 13:38 Gnanasekar Loganathan
2011-01-04 10:46 ` Colin Watson
0 siblings, 1 reply; 8+ messages in thread
From: Gnanasekar Loganathan @ 2011-01-03 13:38 UTC (permalink / raw)
To: The development of GNU GRUB
Hi All,
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 <filename>
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?
Kindly advice or help me....
Thanks,
Gnana
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-03 13:38 Regarding ENV variable Gnanasekar Loganathan
@ 2011-01-04 10:46 ` Colin Watson
2011-01-04 12:30 ` BVK Chaitanya
2011-01-04 12:36 ` Andreas Born
0 siblings, 2 replies; 8+ messages in thread
From: Colin Watson @ 2011-01-04 10:46 UTC (permalink / raw)
To: grub-devel
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 <filename>
>
> 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]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-04 10:46 ` Colin Watson
@ 2011-01-04 12:30 ` BVK Chaitanya
2011-01-04 12:36 ` Andreas Born
1 sibling, 0 replies; 8+ messages in thread
From: BVK Chaitanya @ 2011-01-04 12:30 UTC (permalink / raw)
To: The development of GNU GRUB
No, it is working as expected already; that is below code should
execute echo command and print "foo" already.
set cmd="echo foo"
$cmd
Gnanasekar, what is your grub version? Please try with latest bzr version.
bvk.chaitanya
On Tue, Jan 4, 2011 at 4:16 PM, Colin Watson <cjwatson@ubuntu.com> wrote:
> 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 <filename>
>>
>> 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]
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-04 10:46 ` Colin Watson
2011-01-04 12:30 ` BVK Chaitanya
@ 2011-01-04 12:36 ` Andreas Born
2011-01-04 12:54 ` Colin Watson
1 sibling, 1 reply; 8+ messages in thread
From: Andreas Born @ 2011-01-04 12:36 UTC (permalink / raw)
To: The development of GNU GRUB
I just quickly tested this behaviour with bash (and busybox). With neither of them I needed to use eval. Although eval could be a nice feature, it may be better to consider adapting to this seemingly common behaviour.
Here's the output from bash:
$ blub="blub1 blub2"
$ touch $blub
$ ls $blub
blub1 blub2
$
Regards,
Andreas
----- Ursprüngliche Mitteilung -----
> 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 <filename>
> >
> > 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]
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-04 12:36 ` Andreas Born
@ 2011-01-04 12:54 ` Colin Watson
2011-01-05 9:00 ` Gnanasekar Loganathan
0 siblings, 1 reply; 8+ messages in thread
From: Colin Watson @ 2011-01-04 12:54 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Jan 04, 2011 at 01:36:02PM +0100, Andreas Born wrote:
> I just quickly tested this behaviour with bash (and busybox). With
> neither of them I needed to use eval. Although eval could be a nice
> feature, it may be better to consider adapting to this seemingly
> common behaviour.
Yes, as BVK pointed out I was mistaken. Sorry.
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-04 12:54 ` Colin Watson
@ 2011-01-05 9:00 ` Gnanasekar Loganathan
2011-01-05 9:16 ` BVK Chaitanya
0 siblings, 1 reply; 8+ messages in thread
From: Gnanasekar Loganathan @ 2011-01-05 9:00 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
Please find the attachment.
grub version 1.98
I'm getting the same error 'unkown command'.
If you need any information please revert back to me.
I found alternate way of running those kind variables.
Thanks,
Gnana
On Tue, Jan 4, 2011 at 6:24 PM, Colin Watson <cjwatson@ubuntu.com> wrote:
> On Tue, Jan 04, 2011 at 01:36:02PM +0100, Andreas Born wrote:
>> I just quickly tested this behaviour with bash (and busybox). With
>> neither of them I needed to use eval. Although eval could be a nice
>> feature, it may be better to consider adapting to this seemingly
>> common behaviour.
>
> Yes, as BVK pointed out I was mistaken. Sorry.
>
> --
> Colin Watson [cjwatson@ubuntu.com]
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: image002.jpg --]
[-- Type: image/jpeg, Size: 29908 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-05 9:00 ` Gnanasekar Loganathan
@ 2011-01-05 9:16 ` BVK Chaitanya
2011-01-05 9:21 ` Gnanasekar Loganathan
0 siblings, 1 reply; 8+ messages in thread
From: BVK Chaitanya @ 2011-01-05 9:16 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Jan 5, 2011 at 2:30 PM, Gnanasekar Loganathan
<l.gnanasekar@gmail.com> wrote:
> Please find the attachment.
>
> grub version 1.98
>
Please use bzr version, which is, 1.99~beta Its been already fixed.
bvk.chaitanya
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Regarding ENV variable
2011-01-05 9:16 ` BVK Chaitanya
@ 2011-01-05 9:21 ` Gnanasekar Loganathan
0 siblings, 0 replies; 8+ messages in thread
From: Gnanasekar Loganathan @ 2011-01-05 9:21 UTC (permalink / raw)
To: The development of GNU GRUB
Thanks BVK!
:)
-Gnana
On Wed, Jan 5, 2011 at 2:46 PM, BVK Chaitanya <bvk.groups@gmail.com> wrote:
> On Wed, Jan 5, 2011 at 2:30 PM, Gnanasekar Loganathan
> <l.gnanasekar@gmail.com> wrote:
>> Please find the attachment.
>>
>> grub version 1.98
>>
>
> Please use bzr version, which is, 1.99~beta Its been already fixed.
>
>
>
> bvk.chaitanya
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-01-05 9:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-03 13:38 Regarding ENV variable Gnanasekar Loganathan
2011-01-04 10:46 ` Colin Watson
2011-01-04 12:30 ` BVK Chaitanya
2011-01-04 12:36 ` Andreas Born
2011-01-04 12:54 ` Colin Watson
2011-01-05 9:00 ` Gnanasekar Loganathan
2011-01-05 9:16 ` BVK Chaitanya
2011-01-05 9:21 ` Gnanasekar Loganathan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.