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

Submitter:  Dave Pickens <drummerdp>
Submitted:  Tue 07 Feb 2017 04:50:02 PM UTC
   
 
Category:  Documentation Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Privacy:  Public
Assigned to:  None Originator Name:  Dave Pickens
Open/Closed:  Open Release:  2.02~beta1
Release:  Reproducibility:  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>
Group 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>

 

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

    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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-08 arvidjaar CategoryNone Documentation
        StatusNone Confirmed
        Planned ReleaseNone 2.02
    2017-02-07 drummerdp Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code