Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2022 12:19:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 264656] sh(1): should disregard trailing blanks in variables in arithmetic expressions.
Message-ID:  <bug-264656-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264656

            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=3D234661&action=
=3Dedit
Disregard trailing blanks in variables inside arithmetic expressions

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

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

Patch attached.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264656-227>