bugGNU GRUB - Bugs: bug #50244, Scripting fails on greater and...

 
 

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

bug #50244: Scripting fails on greater and less compares

Submitted by:  Dave Pickens <drummerdp>
Submitted on:  Tue 07 Feb 2017 04:50:02 PM UTC  
 
Category: DocumentationSeverity: Major
Priority: 5 - NormalItem Group: None
Status: ConfirmedPrivacy: Public
Assigned to: NoneOriginator Name: Dave Pickens
Open/Closed: OpenRelease: 
Release: 2.02~beta1Reproducibility: None
Planned Release: 2.02

Wed 08 Feb 2017 09:44:09 AM UTC, comment #1:

This works if you quote it (if [ a "<" b ]); '<' and '>' are special lexical tokens. It's really not different from normal shell where you would need to quote them as well. Not sure whether we really need to make them tokens in grub though.

Anyway for release we can only clarify documentation.

Andrei Borzenkov <arvidjaar>
Project Member
Tue 07 Feb 2017 04:50:02 PM UTC, original submission:

The following script lines fail with a syntax error

set bugtest=a

if [ $bugtest = a ] ; then echo yes ; fi # This works

if [ $bugtest > a ] ; then echo yes ; fi # Fails syntax

if [ $bugtest > 'a' ] ; then echo yes ; fi # Fails syntax

if [ $bugtest > "a" ] ; then echo yes ; fi # Fails syntax

if [ $bugtest > ((a)) ] ; then echo yes ; fi # Fails syntax

Also using the less than sign < fails in the same way with messages:

error: syntax error.
error: Incorrect command.
error: syntax error.

This happens on all releases of Grub 2.02 that I have tried including Grub 2.02 RC1

Dave Pickens <drummerdp>

 

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 arvidjaar (Posted a comment)
  • -unavailable- added by drummerdp (Submitted the item)
  • -unavailable- added by drummerdp
  •  

    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):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Feb 2017 09:44:09 AM UTCarvidjaarCategoryNone=>Documentation
      StatusNone=>Confirmed
      Planned ReleaseNone=>2.02
    Tue 07 Feb 2017 04:50:02 PM UTCdrummerdpCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1