bugGNU GRUB - Bugs: bug #35890, "$@" in grub-script does...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #35890: "$@" in grub-script does not follow bash semantics

Submitted by:  Jordan Uggla <jordanu>
Submitted on:  Mon 19 Mar 2012 03:33:38 AM UTC  
 
Category: NoneSeverity: Major
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: Bazaar - trunkReproducibility: None
Planned Release: None

Mon 19 Mar 2012 01:00:55 PM UTC, comment #2:

For the time being use $* for this usecase.

Vladimir Serbinenko <phcoder>
Project Administrator
Mon 19 Mar 2012 10:47:00 AM UTC, comment #1:

It's not about handling of $@ but that bash first checks whether command is an assignment and only then expands arguments.

Vladimir Serbinenko <phcoder>
Project Administrator
Mon 19 Mar 2012 03:33:38 AM UTC, original submission:

One should be able to put all arguments passed to a function into a single (string) variable with all_arguments="$@". With grub-script currently, only the first argument will be stored in $all. I assume that this happens because of the way constructs like for arg in "$@" are supported, but it does not match bash semantics. Example script which gives different results in bash and grub-script:

function get_all_arguments {
all_arguments="$@"
echo "$all_arguments"
echo "$@"
}

get_all_arguments "argument one" "argument two"

Jordan Uggla <jordanu>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by jordanu (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup