Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jan 2021 19:10:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 251770] /bin/sh: false expansion
Message-ID:  <bug-251770-227-4j8bdyFdyx@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-251770-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-251770-227@https.bugs.freebsd.org/bugzilla/>

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

--- Comment #4 from Steffen (Daode) Nurpmeso <steffen@sdaoden.eu> ---
Sorry for being so late, i wanted to reread the standard text, maybe to ope=
n an
issue.  But i think your last statement pretty much describes the situation=
.=20
(Whereas my initial report was only "from gut".)

3385   4.23        Variable Assignment
3386               In the shell command language, a word consisting of the
following parts:
3387               varname=3Dvalue
3388               When used in a context where assignment is defined to oc=
cur
and at no other time, the value
3389               (representing a word or field) shall be assigned as the
value of the variable denoted by varname.
3390               Note:          For further information, see XCU Section
2.9.1 (on page 2365).

---

75482   2.9.1        Simple Command

75495                    4.    Each variable assignment shall be expanded f=
or
tilde expansion, parameter expansion,
75496                          command substitution, arithmetic expansion, =
and
quote removal prior to assigning the
75497                          value.

---

75501          Variable assignments shall be performed as follows:
75502             =E2=80=A2   If no command name results, variable assignme=
nts shall
affect the current execution
75503                 environment.

---

So everything should be handled sequentially, making it a bug.

---

75504             =E2=80=A2   If the command name is not a special built-in=
 utility or
function, the variable assignments
[.]
75507                 4. In this case it is unspecified:
75508                   =E2=80=94 Whether or not the assignments are visibl=
e for
subsequent expansions in step 4
75509                   =E2=80=94 Whether variable assignments made as side=
-effects of
these expansions are visible for
75510                     subsequent expansions in step 4, or in the current
shell execution environment, or
75511                     both

---

So it allows to setup the "execution environment of the command" entirely f=
rom
the current environment, which is effectively read-only.  As you say.

--=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-251770-227-4j8bdyFdyx>