[Bug 264656] sh(1): should disregard trailing blanks in variables in arithmetic expressions.

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 13 Jun 2022 12:19:02 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264656

            Bug ID: 264656
           Summary: sh(1): should disregard trailing blanks in variables
                    in arithmetic expressions.
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: rajeev_v_pillai@yahoo.com

Created attachment 234661
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=234661&action=edit
Disregard trailing blanks in variables inside arithmetic expressions

sh(1) should disregard any trailing blank chars. in variables inside
arithmetic expressions:

$ x='10     '
$ echo $((x + 1))
sh: arithmetic expression: variable conversion error: "x + 1"
$ 

Patch attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.