3
Grub2 allows for powerful scripting capabilities. if
, while
, function
, etc all mean the language is pretty powerful (Turing complete?).
However, I cannot figure out how to pass parameters in grub2.
grub> function hello {
> echo hello $1
> }
grub>
grub> hello world
hello
grub> # i'd expect to see 'hello world' here
grub> # instead in only get 'hello'
grub>
grub> # this works however
grub> 1=world
grub> hello
hello world
grub>
Does Grub2 allow passing parameters to user defined functions?
Thanks. I have been using the Lua. However, I don't think there will ever be a way to pass parameters to Lua from menu entries. The best I can do is set a variable before invoking the script. My idea was to have a grub function forward its parameters to the Lua script. This way my menu entries look like regular function calls, but the guts can still be Lua. – deft_code – 2010-09-09T18:15:24.727