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


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

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

Submitter:  Jordan Uggla <jordanu>
Submitted:  Mon 19 Mar 2012 03:33:38 AM UTC
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  Bazaar - trunk
Release:  Reproducibility:  None
Planned Release:  2.03+

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

For the time being use $* for  this usecase.

Vladimir Serbinenko <phcoder>
Group 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>
Group 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 {
  echo "$all_arguments"
  echo "$@"

get_all_arguments "argument one" "argument two"

Jordan Uggla <jordanu>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-02 phcoder Planned ReleaseNone 2.03+

    Back to the top

    Powered by Savane 3.13-8484.
    Corresponding source code