The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=1123
======================================================================
Reported By: kre
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 1123
Category: Shell and Utilities
Type: Clarification Requested
Severity: Objection
Priority: normal
Status: New
Name: Robert Elz
Organization:
User Reference:
Section: 2.6
Page Number: 2353
Line Number: 75006-75007
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2017-03-04 07:56 UTC
Last Modified: 2017-03-04 07:56 UTC
======================================================================
Summary: Problematic specification of execution environment
for word expansions
Description:
Section 2.6 says ...
The expansions described in this section shall occur in the same shell
environment as that in which the command is executed.
which makes no sense, first because the expansions are not always being
performed on behalf of a command about to be executed (consider the case
of expanding one of the PSn prompts) and second, because at the time the
expansions are done, we do not yet know what command is to be executed,
and hence, we do not know which execution environment is to be used.
Consider:
case "${something}" in
a) command=exec;;
b) command=echo;;
*) command=;;
esac
${command} ls "${X=3}"
which environment is to be used when expanding ${command} ?
if we had something=a then because exec is a special builtin, the current
(command line processing) environment is to be used. In the other cases,
a new execution environment is created. But until we have expanded
${command}
we don't know which.
In this particular example, it probably makes no real difference, but it
is
easy to come up with others (not involving exec) where it does matter.
Desired Action:
Right now, no idea... Completely re-do section 2.6 to make it rational
would be a good first step.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2017-03-04 07:56 kre New Issue
2017-03-04 07:56 kre Name => Robert Elz
2017-03-04 07:56 kre Section => 2.6
2017-03-04 07:56 kre Page Number => 2353
2017-03-04 07:56 kre Line Number => 75006-75007
======================================================================